Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39fb883

Browse files
committed
try circleci 2.0
- split into four jobs. One build job common to all other test jobs. One job for jasmine, one for image and one syntax test. - test-image job does not work (docker handling is different in 2.0) - test-jasmine has a few failing assertion (different machine in 2.0)
1 parent 82326ba commit 39fb883

File tree

4 files changed

+128
-35
lines changed

4 files changed

+128
-35
lines changed

.circleci/config.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
version: 2.0
2+
3+
# Inspired by:
4+
# https://github.com/CircleCI-Public/circleci-demo-workflows/blob/workspace-forwarding/.circleci/config.yml
5+
# https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
6+
7+
jobs:
8+
build:
9+
docker:
10+
- image: circleci/node:6.10.3
11+
working_directory: ~/repo
12+
steps:
13+
- checkout
14+
- restore_cache:
15+
keys:
16+
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }}
17+
- v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-master-{{ checksum "package.json" }}
18+
- run:
19+
name: Install dependencies
20+
command: |
21+
npm install
22+
npm dedupe
23+
npm prune
24+
npm install
25+
- run:
26+
name: List dependency versions
27+
command: |
28+
echo "npm: $(npm --version)"
29+
echo "node: $(node --version)"
30+
npm ls || true
31+
- run:
32+
name: Pretest
33+
command: |
34+
npm run pretest
35+
npm run cibuild
36+
- save_cache:
37+
paths:
38+
- node_modules
39+
key: v{{ .Environment.CIRCLE_CACHE_VERSION }}-deps-{{ .Branch }}-{{ checksum "package.json" }}
40+
- persist_to_workspace:
41+
root: .
42+
paths:
43+
- node_modules
44+
- build
45+
- dist
46+
47+
test-jasmine:
48+
docker:
49+
# need '-browsers' version to test in real (xvfb-wrapped) browsers
50+
- image: circleci/node:6.10.3-browsers
51+
working_directory: ~/repo
52+
steps:
53+
- checkout
54+
- attach_workspace:
55+
at: ~/repo
56+
- run:
57+
name: Set timezone to Alaska time (arbitrary timezone to test date logic)
58+
command: |
59+
sudo cp /usr/share/zoneinfo/America/Anchorage /etc/localtime
60+
- run:
61+
name: Run jasmine tests
62+
command: ./.circleci/test.sh jasmine
63+
64+
test-image:
65+
docker:
66+
- image: circleci/node:6.10.3
67+
- image: plotly/testbed:latest
68+
working_directory: ~/repo
69+
steps:
70+
- checkout
71+
- attach_workspace:
72+
at: ~/repo
73+
# https://circleci.com/docs/2.0/building-docker-images/
74+
- setup_remote_docker
75+
- run:
76+
name: Run and setup container
77+
command: |
78+
npm run docker -- run
79+
npm run docker -- setup
80+
- run:
81+
name: Run image tests
82+
command: ./.circleci/test.sh image
83+
- store_artifacts:
84+
path: build
85+
86+
test-syntax:
87+
docker:
88+
- image: circleci/node:6.10.3
89+
working_directory: ~/repo
90+
steps:
91+
- checkout
92+
- attach_workspace:
93+
at: ~/repo
94+
- run:
95+
name: Run syntax tests
96+
command: ./.circleci/test.sh syntax
97+
98+
workflows:
99+
version: 2
100+
build-and-test:
101+
jobs:
102+
- build
103+
- test-jasmine:
104+
requires:
105+
- build
106+
- test-image:
107+
requires:
108+
- build
109+
- test-syntax:
110+
requires:
111+
- build

tasks/ci_test.sh renamed to .circleci/test.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
#!/bin/bash
22

3+
# override CircleCi's default run settings
4+
set +e
5+
set +o pipefail
6+
37
EXIT_STATE=0
48

5-
case $CIRCLE_NODE_INDEX in
9+
case $1 in
10+
11+
jasmine)
12+
npm run test-jasmine || EXIT_STATE=$?
13+
npm run test-bundle || EXIT_STATE=$?
14+
exit $EXIT_STATE
15+
;;
616

7-
0)
17+
image)
818
npm run test-image || EXIT_STATE=$?
919
npm run test-image-gl2d || EXIT_STATE=$?
10-
npm run test-bundle || EXIT_STATE=$?
11-
npm run test-syntax || EXIT_STATE=$?
12-
npm run lint || EXIT_STATE=$?
20+
npm run test-export || EXIT_STATE=$?
1321
exit $EXIT_STATE
1422
;;
1523

16-
1)
17-
npm run test-jasmine || EXIT_STATE=$?
18-
npm run test-export || EXIT_STATE=$?
24+
syntax)
25+
npm run lint || EXIT_STATE=$?
26+
npm run test-syntax || EXIT_STATE=$?
1927
exit $EXIT_STATE
2028
;;
2129

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ npm-debug.log*
99
*.sublime*
1010

1111
.*
12+
!.circleci
1213
!.gitignore
1314
!.npmignore
1415
!.eslintrc

circle.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)