@@ -10,154 +10,253 @@ version: 2.0
1010jobs :
1111 install-and-cibuild :
1212 docker :
13- - image : circleci/node:12.13.0
13+ - image : circleci/node:12.22.1
1414 working_directory : ~/plotly.js
1515 steps :
1616 - checkout
1717 - run :
18- name : set heap option before very first node.js call
19- command : |
20- export NODE_OPTIONS='--max-old-space-size=4096'
21- - run :
22- name : Install dependencies
23- command : |
24- npm ci
25- - run :
26- name : List dependency versions
27- command : |
28- echo "npm: $(npm --version)"
29- echo "node: $(node --version)"
30- npm ls || true
18+ name : Set up build environment
19+ command : .circleci/env_build.sh
3120 - run :
3221 name : Pretest
33- command : |
34- npm run pretest
35- npm run cibuild
22+ command : npm run pretest
3623 - run :
24+ name : CI-Build
25+ command : npm run cibuild
26+ - run :
27+ name : Delete git
3728 command : rm -rf .git
3829 - persist_to_workspace :
3930 root : /home/circleci
4031 paths :
4132 - plotly.js
4233
34+ timezone-jasmine :
35+ docker :
36+ # need '-browsers' version to test in real (xvfb-wrapped) browsers
37+ - image : circleci/node:12.22.1-browsers
38+ working_directory : ~/plotly.js
39+ steps :
40+ - attach_workspace :
41+ at : ~/
42+ - run :
43+ name : Run hover_label test in UTC timezone
44+ environment :
45+ TZ : " UTC"
46+ command : date && npm run test-jasmine hover_label
47+ - run :
48+ name : Run hover_label test in Europe/Berlin timezone
49+ environment :
50+ TZ : " Europe/Berlin"
51+ command : date && npm run test-jasmine hover_label
52+ - run :
53+ name : Run hover_label test in Asia/Tokyo timezone
54+ environment :
55+ TZ : " Asia/Tokyo"
56+ command : date && npm run test-jasmine hover_label
57+ - run :
58+ name : Run hover_label test in America/Toronto timezone
59+ environment :
60+ TZ : " America/Toronto"
61+ command : date && npm run test-jasmine hover_label
62+
4363 no-gl-jasmine :
4464 docker :
4565 # need '-browsers' version to test in real (xvfb-wrapped) browsers
46- - image : circleci/node:12.13.0-browsers
47- parallelism : 2
66+ - image : circleci/node:12.22.1-browsers
67+ environment :
68+ # Alaska time (arbitrary timezone to test date logic)
69+ TZ : " America/Anchorage"
70+ parallelism : 8
4871 working_directory : ~/plotly.js
4972 steps :
5073 - attach_workspace :
5174 at : ~/
5275 - run :
5376 name : Run jasmine tests (part A)
54- command : ./. circleci/test.sh no-gl-jasmine
77+ command : .circleci/test.sh no-gl-jasmine
5578
5679 webgl-jasmine :
5780 docker :
5881 # need '-browsers' version to test in real (xvfb-wrapped) browsers
59- - image : circleci/node:12.13.0-browsers
60- parallelism : 3
82+ - image : circleci/node:12.22.1-browsers
83+ environment :
84+ # Alaska time (arbitrary timezone to test date logic)
85+ TZ : " America/Anchorage"
86+ parallelism : 8
6187 working_directory : ~/plotly.js
6288 steps :
6389 - attach_workspace :
6490 at : ~/
6591 - run :
6692 name : Run jasmine tests (part B)
67- command : ./. circleci/test.sh webgl-jasmine
93+ command : .circleci/test.sh webgl-jasmine
6894
69- no-gl-flaky -jasmine :
95+ flaky- no-gl-jasmine :
7096 docker :
7197 # need '-browsers' version to test in real (xvfb-wrapped) browsers
72- - image : circleci/node:12.13.0-browsers
98+ - image : circleci/node:12.22.1-browsers
99+ environment :
100+ # Alaska time (arbitrary timezone to test date logic)
101+ TZ : " America/Anchorage"
73102 working_directory : ~/plotly.js
74103 steps :
75104 - attach_workspace :
76105 at : ~/
77106 - run :
78107 name : Run jasmine tests (part C)
79- command : ./. circleci/test.sh no-gl-flaky -jasmine
108+ command : .circleci/test.sh flaky- no-gl-jasmine
80109
81- stable-image :
110+ bundle-jasmine :
82111 docker :
83- - image : plotly/testbed:latest
112+ # need '-browsers' version to test in real (xvfb-wrapped) browsers
113+ - image : circleci/node:12.22.1-browsers
114+ environment :
115+ # Alaska time (arbitrary timezone to test date logic)
116+ TZ : " America/Anchorage"
117+ working_directory : ~/plotly.js
118+ steps :
119+ - attach_workspace :
120+ at : ~/
121+ - run :
122+ name : Run jasmine tests (part D)
123+ command : .circleci/test.sh bundle-jasmine
124+
125+ make-baselines :
84126 parallelism : 4
85- working_directory : /var/www/streambed/image_server/plotly.js/
127+ docker :
128+ - image : circleci/python:3.8.9
129+ working_directory : ~/plotly.js
86130 steps :
87131 - attach_workspace :
88- at : /var/www/streambed/image_server /
132+ at : ~ /
89133 - run :
90- name : Run and setup container
91- command : |
92- supervisord &
93- npm run docker -- setup
134+ name : Install kaleido, plotly.io and required fonts
135+ command : .circleci/env_image.sh
94136 - run :
95- name : Run image tests (part A)
96- command : ./.circleci/test.sh stable-image
137+ name : Create all png files
138+ command : .circleci/test.sh make-baselines
139+ - persist_to_workspace :
140+ root : ~/
141+ paths :
142+ - plotly.js
143+
144+ test-baselines :
145+ docker :
146+ - image : circleci/node:12.22.1
147+ working_directory : ~/plotly.js
148+ steps :
149+ - attach_workspace :
150+ at : ~/
151+ - run :
152+ name : Compare pixels
153+ command : .circleci/test.sh test-image ; find build -maxdepth 1 -type f -delete
97154 - store_artifacts :
98155 path : build
99156 destination : /
100157
101- flaky-image :
158+ make-exports :
102159 docker :
103- - image : plotly/testbed:latest
104- working_directory : /var/www/streambed/image_server/ plotly.js/
160+ - image : circleci/python:3.8.9
161+ working_directory : ~/ plotly.js
105162 steps :
106163 - attach_workspace :
107- at : /var/www/streambed/image_server /
164+ at : ~ /
108165 - run :
109- name : Run and setup container
110- command : |
111- supervisord &
112- npm run docker -- setup
166+ name : Install kaleido, plotly.io and required fonts
167+ command : .circleci/env_image.sh
168+ - run :
169+ name : Install poppler-utils to have pdftops for exporting eps
170+ command : sudo apt-get install poppler-utils
171+ - run :
172+ name : Create svg, jpg, jpeg, webp, pdf and eps files
173+ command : python3 test/image/make_exports.py
174+ - persist_to_workspace :
175+ root : ~/
176+ paths :
177+ - plotly.js
178+
179+ test-exports :
180+ docker :
181+ - image : circleci/node:12.22.1
182+ working_directory : ~/plotly.js
183+ steps :
184+ - attach_workspace :
185+ at : ~/
113186 - run :
114- name : Run image tests (part B)
115- command : ./.circleci/test.sh flaky-image
187+ name : Test export sizes
188+ command : node test/image/export_test.js ; find build -maxdepth 1 -type f -delete
116189 - store_artifacts :
117190 path : build
118191 destination : /
119192
120- source-syntax :
193+ mock-validation :
121194 docker :
122- - image : circleci/node:12.13.0
195+ - image : circleci/node:12.22.1
123196 working_directory : ~/plotly.js
124197 steps :
125198 - attach_workspace :
126199 at : ~/
127200 - run :
128- name : Run syntax tests on source files
129- command : ./.circleci/test.sh source-syntax
201+ name : Test validation using node.js and jsdom
202+ command : npm run test-plain-obj
203+ - run :
204+ name : Validate mocks
205+ command : npm run test-mock
130206
131- jasmine-bundle :
207+ source-syntax :
132208 docker :
133- # need '-browsers' version to test in real (xvfb-wrapped) browsers
134- - image : circleci/node:12.13.0-browsers
209+ - image : circleci/node:12.22.1
135210 working_directory : ~/plotly.js
136211 steps :
137212 - attach_workspace :
138213 at : ~/
139214 - run :
140- name : Run jasmine tests (part D)
141- command : ./. circleci/test.sh jasmine-bundle
215+ name : Run syntax tests on source files
216+ command : .circleci/test.sh source-syntax
142217
143218 publish-dist :
144219 docker :
145- - image : circleci/node:12.13.0
220+ - image : circleci/node:12.22.1
146221 working_directory : ~/plotly.js
147222 steps :
148- - attach_workspace :
149- at : ~/
223+ - checkout
224+ - run :
225+ name : Set up build environment
226+ command : .circleci/env_build.sh
227+ - run :
228+ name : Preview CHANGELOG for next release (only on master)
229+ command : |
230+ if [ $CIRCLE_BRANCH == "master" ]
231+ then npm run use-draftlogs && git --no-pager diff --color-words CHANGELOG.md || true
232+ fi
233+ - run :
234+ name : Set draft version in package.json
235+ command : |
236+ node --eval "var fs = require('fs'); var inOut = './package.json'; var data = JSON.parse(fs.readFileSync(inOut)); var a = process.argv; data.version = a[a.length - 1].replace('v', ''); fs.writeFileSync(inOut, JSON.stringify(data, null, 2) + '\n');" `git describe`
237+ - run :
238+ name : View package.json diff between previous and next releases (including above draft version change)
239+ command : git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true
150240 - run :
151241 name : Build dist/
152242 command : npm run build
153243 - store_artifacts :
154244 path : dist
155245 destination : dist
246+ - run :
247+ name : View dist/README.md diff between previous and next releases (including new bundle sizes)
248+ command : git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) dist/README.md || true
249+ - run :
250+ name : Preview plot-schema diff between previous and next releases (only on master)
251+ command : |
252+ if [ $CIRCLE_BRANCH == "master" ]
253+ then git --no-pager diff tags/$(git describe --tags --abbrev=0) dist/plot-schema.json || true
254+ fi
156255 - run :
157256 name : Pack tarball
158257 command : |
159258 npm pack
160- version=$(node -e "console.log(require('./package.json').version)")
259+ version=$(node --eval "console.log(require('./package.json').version)")
161260 mv plotly.js-$version.tgz plotly.js.tgz
162261 - store_artifacts :
163262 path : plotly.js.tgz
@@ -171,32 +270,33 @@ jobs:
171270 echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js
172271 echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json
173272 - run :
174- name : Test validation using node.js and jsdom
175- command : npm run test-plain-obj
273+ name : Test plot-schema.json diff - If failed, after (npm start) you could run (npm run schema && git add test/plot-schema.json && git commit -m "update plot-schema diff")
274+ command : diff --unified --color dist/plot-schema.json test/plot-schema.json
176275 - run :
177276 name : Test plotly.min.js import using requirejs
178277 command : npm run test-requirejs
179278 - run :
180279 name : Test plotly bundles againt unexpected characters
181280 command : npm run no-bad-char
281+ - run :
282+ name : Display function constructors in plotly.js bundle
283+ command : npm run log-new-func
182284 - run :
183285 name : Test certain bundles against function constructors
184286 command : npm run no-new-func
185287 - run :
186288 name : Test plotly bundles against es6
187289 command : npm run no-es6-dist
188- - run :
189- name : Test plotly bundles againt duplicate keys
190- environment :
191- NODE_OPTIONS : --max_old_space_size=4096
192- command : npm run no-dup-keys
193290
194291workflows :
195292 version : 2
196293 build-and-test :
197294 jobs :
198295 - install-and-cibuild
199- - jasmine-bundle :
296+ - timezone-jasmine :
297+ requires :
298+ - install-and-cibuild
299+ - bundle-jasmine :
200300 requires :
201301 - install-and-cibuild
202302 - no-gl-jasmine :
@@ -205,18 +305,26 @@ workflows:
205305 - webgl-jasmine :
206306 requires :
207307 - install-and-cibuild
208- - no-gl-flaky -jasmine :
308+ - flaky- no-gl-jasmine :
209309 requires :
210310 - install-and-cibuild
211- - stable-image :
311+ - make-baselines :
212312 requires :
213313 - install-and-cibuild
214- - flaky-image :
314+ - test-baselines :
315+ requires :
316+ - make-baselines
317+ - make-exports :
215318 requires :
216319 - install-and-cibuild
217- - source-syntax :
320+ - test-exports :
321+ requires :
322+ - make-exports
323+ - mock-validation :
218324 requires :
219325 - install-and-cibuild
220- - publish-dist :
326+ - source-syntax :
221327 requires :
222328 - install-and-cibuild
329+
330+ - publish-dist
0 commit comments