mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Parallelize CircleCI tests
This commit is contained in:
12
.travis.yml
12
.travis.yml
@@ -2,16 +2,6 @@ sudo: false # use faster docker containers
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "0.12"
|
- "0.12"
|
||||||
before_script:
|
script: bin/ci.sh
|
||||||
- npm install -g eslint
|
|
||||||
- npm install -g esprima-fb # allow flow type annotations in eslint
|
|
||||||
- curl 'https://raw.githubusercontent.com/ripple/javascript-style-guide/es6/eslintrc' > ./eslintrc
|
|
||||||
- 'echo "parser: esprima-fb" >> ./eslintrc'
|
|
||||||
- eslint --reset -c ./eslintrc $(git --no-pager diff --name-only -M100% --diff-filter=AM --relative $(git merge-base FETCH_HEAD origin/HEAD) FETCH_HEAD | grep "\.js$")
|
|
||||||
- npm install -g flow-bin
|
|
||||||
- npm run typecheck
|
|
||||||
script: MOCHA_REPORTER=tap npm test --coverage
|
|
||||||
after_success:
|
|
||||||
- npm run coveralls
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
|||||||
54
bin/ci.sh
Executable file
54
bin/ci.sh
Executable file
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/bash -ex
|
||||||
|
|
||||||
|
NODE_INDEX="$1"
|
||||||
|
TOTAL_NODES="$2"
|
||||||
|
|
||||||
|
typecheck() {
|
||||||
|
npm install -g flow-bin
|
||||||
|
npm run typecheck
|
||||||
|
}
|
||||||
|
|
||||||
|
lint() {
|
||||||
|
REPO_URL="https://raw.githubusercontent.com/ripple/javascript-style-guide"
|
||||||
|
npm install -g eslint
|
||||||
|
npm install -g esprima-fb # allow flow type annotations in eslint
|
||||||
|
curl "$REPO_URL/es6/eslintrc" > ./eslintrc
|
||||||
|
echo "parser: esprima-fb" >> ./eslintrc
|
||||||
|
eslint --reset -c ./eslintrc $(git --no-pager diff --name-only -M100% --diff-filter=AM --relative $(git merge-base FETCH_HEAD origin/HEAD) FETCH_HEAD | grep "\.js$")
|
||||||
|
}
|
||||||
|
|
||||||
|
unittest() {
|
||||||
|
npm test --coverage
|
||||||
|
npm run coveralls
|
||||||
|
}
|
||||||
|
|
||||||
|
oneNode() {
|
||||||
|
lint
|
||||||
|
typecheck
|
||||||
|
unittest
|
||||||
|
}
|
||||||
|
|
||||||
|
twoNodes() {
|
||||||
|
case "$NODE_INDEX" in
|
||||||
|
0) lint && unittest;;
|
||||||
|
1) typecheck;;
|
||||||
|
*) echo "ERROR: invalid usage"; exit 2;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
threeNodes() {
|
||||||
|
case "$NODE_INDEX" in
|
||||||
|
0) lint;;
|
||||||
|
1) typecheck;;
|
||||||
|
2) unittest;;
|
||||||
|
*) echo "ERROR: invalid usage"; exit 2;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$TOTAL_NODES" in
|
||||||
|
"") oneNode;;
|
||||||
|
1) oneNode;;
|
||||||
|
2) twoNodes;;
|
||||||
|
3) threeNodes;;
|
||||||
|
*) echo "ERROR: invalid usage"; exit 2;;
|
||||||
|
esac
|
||||||
15
circle.yml
15
circle.yml
@@ -1,18 +1,7 @@
|
|||||||
machine:
|
machine:
|
||||||
node:
|
node:
|
||||||
version: 0.12.0
|
version: 0.12.0
|
||||||
dependencies:
|
|
||||||
post:
|
|
||||||
- npm install -g eslint
|
|
||||||
- npm install -g esprima-fb # allow flow type annotations in eslint
|
|
||||||
- npm install -g flow-bin
|
|
||||||
test:
|
test:
|
||||||
pre:
|
|
||||||
- curl 'https://raw.githubusercontent.com/ripple/javascript-style-guide/es6/eslintrc' > ./eslintrc
|
|
||||||
- 'echo "parser: esprima-fb" >> ./eslintrc'
|
|
||||||
- eslint --reset -c ./eslintrc $(git --no-pager diff --name-only -M100% --diff-filter=AM --relative $(git merge-base FETCH_HEAD origin/HEAD) FETCH_HEAD | grep "\.js$")
|
|
||||||
- npm run typecheck
|
|
||||||
override:
|
override:
|
||||||
- npm test --coverage
|
- bin/ci.sh "$CIRCLE_NODE_INDEX" "$CIRCLE_NODE_TOTAL":
|
||||||
post:
|
parallel: true
|
||||||
- npm run coveralls
|
|
||||||
|
|||||||
Reference in New Issue
Block a user