-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test with CircleCI 2.0 #2310
Test with CircleCI 2.0 #2310
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
version: 2.0 | ||
|
||
# Inspired by: | ||
# https://github.com/CircleCI-Public/circleci-demo-workflows/blob/workspace-forwarding/.circleci/config.yml | ||
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs | ||
|
||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/node:6.10.3 | ||
working_directory: ~/plotly.js | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }} | ||
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-master-{{ checksum "package.json" }} | ||
- run: | ||
name: Install dependencies | ||
command: | | ||
npm install | ||
npm dedupe | ||
npm prune | ||
npm install | ||
- run: | ||
name: List dependency versions | ||
command: | | ||
echo "npm: $(npm --version)" | ||
echo "node: $(node --version)" | ||
npm ls || true | ||
- run: | ||
name: Pretest | ||
command: | | ||
npm run pretest | ||
npm run cibuild | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }} | ||
- persist_to_workspace: | ||
root: . | ||
paths: | ||
- node_modules | ||
- build | ||
- dist | ||
|
||
test-jasmine: | ||
docker: | ||
# need '-browsers' version to test in real (xvfb-wrapped) browsers | ||
- image: circleci/node:6.10.3-browsers | ||
working_directory: ~/plotly.js | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: ~/plotly.js | ||
- run: | ||
name: Set timezone to Alaska time (arbitrary timezone to test date logic) | ||
command: | | ||
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime | ||
- run: | ||
name: Run jasmine tests | ||
command: ./.circleci/test.sh jasmine | ||
|
||
test-image: | ||
docker: | ||
- image: plotly/testbed:latest | ||
working_directory: /var/www/streambed/image_server/plotly.js/ | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: /var/www/streambed/image_server/plotly.js/ | ||
- run: | ||
name: Run and setup container | ||
command: | | ||
supervisord & | ||
npm run docker -- setup | ||
- run: | ||
name: Run image tests | ||
command: ./.circleci/test.sh image | ||
- store_artifacts: | ||
path: build | ||
|
||
test-syntax: | ||
docker: | ||
- image: circleci/node:6.10.3 | ||
working_directory: ~/plotly.js | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: ~/plotly.js | ||
- run: | ||
name: Run syntax tests | ||
command: ./.circleci/test.sh syntax | ||
|
||
workflows: | ||
version: 2 | ||
build-and-test: | ||
jobs: | ||
- build | ||
- test-jasmine: | ||
requires: | ||
- build | ||
- test-image: | ||
requires: | ||
- build | ||
- test-syntax: | ||
requires: | ||
- build |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ npm-debug.log* | |
*.sublime* | ||
|
||
.* | ||
!.circleci | ||
!.gitignore | ||
!.npmignore | ||
!.eslintrc | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ | |
"start-image_viewer": "node devtools/image_viewer/server.js", | ||
"start": "npm run start-test_dashboard", | ||
"baseline": "node tasks/baseline.js", | ||
"preversion": "npm-link-check && npm dedupe", | ||
"preversion": "npm-link-check && npm dedupe && npm ls --prod", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This commit partly reverts 1d3a3f0
|
||
"version": "npm run build && git add -A dist src build", | ||
"postversion": "node -e \"console.log('Version bumped and committed. If ok, run: git push && git push --tags')\"" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,4 @@ npm run test-jasmine -- --tags=noCI --nowatch || EXIT_STATE=$? | |
# mapbox image tests take too much resources on CI | ||
npm run test-image -- mapbox_* --queue || EXIT_STATE=$? | ||
|
||
# run gl2d image test again (some mocks are skipped on CI) | ||
npm run test-image-gl2d || EXIT_STATE=$? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixup for 9f304e6 No need for this line anymore as now all gl2d mocks are tested on CI. |
||
|
||
exit $EXIT_STATE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like CircleCI's new defaults where a given job stop executing after the first test failure. I prefer running all the tests no matter what, to see if a given commit makes multiple tests fail. I hope you agree with me.