forked from vitessce/vitessce
-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.sh
executable file
·43 lines (35 loc) · 999 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
set -o errexit
start() { echo travis_fold':'start:$1; echo $1; }
end() { echo travis_fold':'end:$1; }
die() { set +v; echo "$*" 1>&2 ; sleep 1; exit 1; }
# Race condition truncates logs on Travis: "sleep" might help.
# https://github.com/travis-ci/travis-ci/issues/6018
PATH=$PATH:`npm bin`
start changelog
if [ "$GITHUB_REF" != 'refs/heads/main' ]; then
diff CHANGELOG.md <(curl https://raw.githubusercontent.com/vitessce/vitessce/main/CHANGELOG.md) \
&& die 'Update CHANGELOG.md'
fi
end changelog
start lint
eslint src || die 'eslint failed; try: npm run lint-fix'
end lint
start test
npm test
end test
start cypress
# Cypress fails randomly on GH Actions so we only run this locally.
if [ "$CI" != 'true' ]; then
npm start & wait-on http://localhost:3000/
npm run cypress:run
echo 'NOTE: Server is still running.'
fi
end cypress
start schema
./src/schemas/schema-schema.sh
end schema
start build
npm run build:prod
node ./scripts/verify-build.js
end build