-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Test with CircleCI 2.0 #2310
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
Merged
Test with CircleCI 2.0 #2310
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.