-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
config.yml
371 lines (352 loc) · 9.31 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
version: 2.1
orbs:
aws-cli: circleci/aws-cli@1.4.0
browser-tools: circleci/browser-tools@1.2.3
workflows:
version: 2
default:
jobs:
- prepare:
filters:
tags:
only: /.*/
- install-mbx-ci:
requires:
- prepare
filters:
tags:
only: /.*/
# We can't install mbx-ci on CI runs from PR's that reference forks from external contributors
# This is because fork's can not access our AWS credentials setup in CircleCI environment variables
# Branch names for external contributor forks are are reported in the format pull/{PR_NUMBER} to CircleCI,
# This RegEx is setup to ignore that.
branches:
ignore: /pull\/[0-9]*/
- lint:
requires:
- prepare
filters:
tags:
only: /.*/
- build:
requires:
- prepare
filters:
tags:
only: /.*/
- check-bundle-size:
requires:
- prepare
- install-mbx-ci
- build
filters:
tags:
only: /.*/
- test-flow:
requires:
- prepare
filters:
tags:
only: /.*/
- test-unit:
requires:
- prepare
filters:
tags:
only: /.*/
- test-render:
requires:
- prepare
filters:
tags:
only: /.*/
- test-render-prod:
requires:
- prepare
filters:
tags:
only: /.*/
- test-query:
requires:
- prepare
filters:
tags:
only: /.*/
- test-expressions:
requires:
- prepare
filters:
tags:
only: /.*/
- test-browser:
requires:
- prepare
filters:
tags:
only: /.*/
- test-webpack:
requires:
- build
filters:
tags:
only: /.*/
- collect-stats:
requires:
- build
- install-mbx-ci
filters:
tags:
ignore: /.*/
branches:
only: main
- deploy-benchmarks:
requires:
- install-mbx-ci
- lint
- build
- test-flow
- test-unit
- test-render
- test-render-prod
- test-query
- test-expressions
filters:
tags:
only: /v[0-9]+.[0-9]+.[0-9]+(-.+)?/
branches:
only:
- main
- /release-.*/
- deploy-release:
requires:
- install-mbx-ci
- lint
- build
- test-flow
- test-unit
- test-render
- test-render-prod
- test-query
- test-expressions
filters:
tags:
only: /v[0-9]+.[0-9]+.[0-9]+(-.+)?/
branches:
ignore: /.*/
defaults: &defaults
docker:
- image: cimg/node:14.15-browsers
working_directory: ~/mapbox-gl-js
jobs:
prepare:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v4-yarn-{{ checksum "yarn.lock" }}
- run: yarn
- save_cache:
key: v4-yarn-{{ checksum "yarn.lock" }}
paths:
- '~/.yarn'
- 'node_modules'
- persist_to_workspace:
root: ~/
paths:
- mapbox-gl-js
- .ssh
install-mbx-ci:
<<: *defaults
steps:
- run:
name: Install mbx-ci
command: |
curl -Ls https://mapbox-release-engineering.s3.amazonaws.com/mbx-ci/latest/mbx-ci-linux-amd64 > ~/mbx-ci &&
chmod 755 ~/mbx-ci &&
~/mbx-ci aws setup
# mbx-ci stores credentials in these directories, so they must be explictly passed along to dependent jobs via workspaces
- persist_to_workspace:
root: ~/
paths:
- .ssh
- .aws
- mbx-ci
lint:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- restore_cache:
keys:
- v2-lint-{{ .Branch }}
- v2-lint
- run: yarn run lint
- run: yarn run lint-css
- save_cache:
key: v2-lint-{{ .Branch }}-{{ .Revision }}
paths:
- '.eslintcache'
build:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: yarn run build-prod-min
- run: yarn run build-prod
- run: yarn run build-csp
- run: yarn run build-dev
- run: yarn run build-css
- run: yarn run build-style-spec
- run: yarn run build-flow-types
- run: yarn run test-build
- store_artifacts:
path: "dist"
- store_artifacts:
path: "test/release"
- persist_to_workspace:
root: ~/
paths:
- mapbox-gl-js/dist
check-bundle-size:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Check bundle size
command: |
node build/check-bundle-size.js
test-flow:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: yarn run test-flow
test-unit:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: yarn run test-unit
test-render:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- browser-tools/install-chrome
- run: yarn run test-render
- store_test_results:
path: test/integration/render-tests
- store_artifacts:
path: "test/integration/render-tests/index.html"
test-render-prod:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- browser-tools/install-chrome
- run: yarn run test-render-prod
- store_test_results:
path: test/integration/render-tests
- store_artifacts:
path: "test/integration/render-tests/index.html"
test-query:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- browser-tools/install-chrome
- run: yarn run test-query
- store_test_results:
path: test/integration/query-tests
- store_artifacts:
path: "test/integration/query-tests/index.html"
test-webpack:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Build Webpack
command: |
cd ./test/build/transpilation &&
yarn &&
npm run build &&
rm -rf node_modules
- store_artifacts:
path: "test/build/transpilation"
collect-stats:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- browser-tools/install-chrome
- run:
name: Collect performance stats
command: node bench/gl-stats.js
- aws-cli/install
- run:
name: Upload performance stats
command: aws s3 cp data.json.gz s3://mapbox-loading-dock/raw/gl_js.perf_metrics_staging/ci/`git show -s --date=short --format=%cd-%h HEAD`.json.gz
test-browser:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- browser-tools/install-browser-tools:
chrome-version: 91.0.4472.164
- run: yarn run build-dev
- run: yarn run build-token
- run:
name: Test Chrome
environment:
SELENIUM_BROWSER: chrome
TAP_COLORS: 1
command: yarn run test-browser
- run:
name: Test Firefox
environment:
SELENIUM_BROWSER: firefox
TAP_COLORS: 1
command: yarn run test-browser
test-expressions:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run: yarn run test-expressions
deploy-benchmarks:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- run:
name: Build
command: BENCHMARK_VERSION="${CIRCLE_TAG:-$CIRCLE_BRANCH} $(git rev-parse --short=7 HEAD)" yarn run build-benchmarks
- aws-cli/install
- run:
name: Upload benchmark
command: aws s3 cp --acl public-read --content-type application/javascript bench/versions/benchmarks_generated.js s3://mapbox-gl-js/${CIRCLE_TAG:-$CIRCLE_BRANCH}/benchmarks.js
- run:
name: Upload source maps
command: aws s3 cp --acl public-read --content-type application/javascript bench/versions/benchmarks_generated.js.map s3://mapbox-gl-js/${CIRCLE_TAG:-$CIRCLE_BRANCH}/benchmarks.js.map
deploy-release:
<<: *defaults
steps:
- attach_workspace:
at: ~/
- aws-cli/install
- run:
name: Check build file for correct SDK version
command: |
if grep -q "\"${CIRCLE_TAG:1}\"" ./dist/mapbox-gl.js; then
echo SDK version in mapbox-gl.js matches ${CIRCLE_TAG:1}
else
echo SDK version in mapbox-gl.js does not match ${CIRCLE_TAG:1}
exit 1
fi
- run:
name: Deploy release
command: |
bash ./build/upload.sh