@@ -10,154 +10,253 @@ version: 2.0
10
10
jobs :
11
11
install-and-cibuild :
12
12
docker :
13
- - image : circleci/node:12.13.0
13
+ - image : circleci/node:12.22.1
14
14
working_directory : ~/plotly.js
15
15
steps :
16
16
- checkout
17
17
- 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
31
20
- run :
32
21
name : Pretest
33
- command : |
34
- npm run pretest
35
- npm run cibuild
22
+ command : npm run pretest
36
23
- run :
24
+ name : CI-Build
25
+ command : npm run cibuild
26
+ - run :
27
+ name : Delete git
37
28
command : rm -rf .git
38
29
- persist_to_workspace :
39
30
root : /home/circleci
40
31
paths :
41
32
- plotly.js
42
33
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
+
43
63
no-gl-jasmine :
44
64
docker :
45
65
# 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
48
71
working_directory : ~/plotly.js
49
72
steps :
50
73
- attach_workspace :
51
74
at : ~/
52
75
- run :
53
76
name : Run jasmine tests (part A)
54
- command : ./. circleci/test.sh no-gl-jasmine
77
+ command : .circleci/test.sh no-gl-jasmine
55
78
56
79
webgl-jasmine :
57
80
docker :
58
81
# 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
61
87
working_directory : ~/plotly.js
62
88
steps :
63
89
- attach_workspace :
64
90
at : ~/
65
91
- run :
66
92
name : Run jasmine tests (part B)
67
- command : ./. circleci/test.sh webgl-jasmine
93
+ command : .circleci/test.sh webgl-jasmine
68
94
69
- no-gl-flaky -jasmine :
95
+ flaky- no-gl-jasmine :
70
96
docker :
71
97
# 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"
73
102
working_directory : ~/plotly.js
74
103
steps :
75
104
- attach_workspace :
76
105
at : ~/
77
106
- run :
78
107
name : Run jasmine tests (part C)
79
- command : ./. circleci/test.sh no-gl-flaky -jasmine
108
+ command : .circleci/test.sh flaky- no-gl-jasmine
80
109
81
- stable-image :
110
+ bundle-jasmine :
82
111
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 :
84
126
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
86
130
steps :
87
131
- attach_workspace :
88
- at : /var/www/streambed/image_server /
132
+ at : ~ /
89
133
- 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
94
136
- 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
97
154
- store_artifacts :
98
155
path : build
99
156
destination : /
100
157
101
- flaky-image :
158
+ make-exports :
102
159
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
105
162
steps :
106
163
- attach_workspace :
107
- at : /var/www/streambed/image_server /
164
+ at : ~ /
108
165
- 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 : ~/
113
186
- 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
116
189
- store_artifacts :
117
190
path : build
118
191
destination : /
119
192
120
- source-syntax :
193
+ mock-validation :
121
194
docker :
122
- - image : circleci/node:12.13.0
195
+ - image : circleci/node:12.22.1
123
196
working_directory : ~/plotly.js
124
197
steps :
125
198
- attach_workspace :
126
199
at : ~/
127
200
- 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
130
206
131
- jasmine-bundle :
207
+ source-syntax :
132
208
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
135
210
working_directory : ~/plotly.js
136
211
steps :
137
212
- attach_workspace :
138
213
at : ~/
139
214
- 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
142
217
143
218
publish-dist :
144
219
docker :
145
- - image : circleci/node:12.13.0
220
+ - image : circleci/node:12.22.1
146
221
working_directory : ~/plotly.js
147
222
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
150
240
- run :
151
241
name : Build dist/
152
242
command : npm run build
153
243
- store_artifacts :
154
244
path : dist
155
245
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
156
255
- run :
157
256
name : Pack tarball
158
257
command : |
159
258
npm pack
160
- version=$(node -e "console.log(require('./package.json').version)")
259
+ version=$(node --eval "console.log(require('./package.json').version)")
161
260
mv plotly.js-$version.tgz plotly.js.tgz
162
261
- store_artifacts :
163
262
path : plotly.js.tgz
@@ -171,32 +270,33 @@ jobs:
171
270
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js
172
271
echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json
173
272
- 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
176
275
- run :
177
276
name : Test plotly.min.js import using requirejs
178
277
command : npm run test-requirejs
179
278
- run :
180
279
name : Test plotly bundles againt unexpected characters
181
280
command : npm run no-bad-char
281
+ - run :
282
+ name : Display function constructors in plotly.js bundle
283
+ command : npm run log-new-func
182
284
- run :
183
285
name : Test certain bundles against function constructors
184
286
command : npm run no-new-func
185
287
- run :
186
288
name : Test plotly bundles against es6
187
289
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
193
290
194
291
workflows :
195
292
version : 2
196
293
build-and-test :
197
294
jobs :
198
295
- install-and-cibuild
199
- - jasmine-bundle :
296
+ - timezone-jasmine :
297
+ requires :
298
+ - install-and-cibuild
299
+ - bundle-jasmine :
200
300
requires :
201
301
- install-and-cibuild
202
302
- no-gl-jasmine :
@@ -205,18 +305,26 @@ workflows:
205
305
- webgl-jasmine :
206
306
requires :
207
307
- install-and-cibuild
208
- - no-gl-flaky -jasmine :
308
+ - flaky- no-gl-jasmine :
209
309
requires :
210
310
- install-and-cibuild
211
- - stable-image :
311
+ - make-baselines :
212
312
requires :
213
313
- install-and-cibuild
214
- - flaky-image :
314
+ - test-baselines :
315
+ requires :
316
+ - make-baselines
317
+ - make-exports :
215
318
requires :
216
319
- install-and-cibuild
217
- - source-syntax :
320
+ - test-exports :
321
+ requires :
322
+ - make-exports
323
+ - mock-validation :
218
324
requires :
219
325
- install-and-cibuild
220
- - publish-dist :
326
+ - source-syntax :
221
327
requires :
222
328
- install-and-cibuild
329
+
330
+ - publish-dist
0 commit comments