@@ -7,17 +7,11 @@ aliases:
7
7
- &environment
8
8
TZ : /usr/share/zoneinfo/America/Los_Angeles
9
9
10
- - &restore_yarn_cache
10
+ - &restore_node_modules
11
11
restore_cache :
12
12
name : Restore node_modules cache
13
13
keys :
14
- - v2-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
15
- - v2-node-{{ arch }}-{{ .Branch }}-
16
- - v2-node-{{ arch }}-
17
- - &run_yarn
18
- run :
19
- name : Install Packages
20
- command : yarn --frozen-lockfile
14
+ - v2-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}-node-modules
21
15
22
16
- &TEST_PARALLELISM 20
23
17
@@ -30,8 +24,7 @@ aliases:
30
24
steps :
31
25
- checkout
32
26
- attach_workspace : *attach_workspace
33
- - *restore_yarn_cache
34
- - *run_yarn
27
+ - *restore_node_modules
35
28
- run : node ./scripts/rollup/consolidateBundleSizes.js
36
29
- run : ./scripts/circleci/pack_and_store_artifact.sh
37
30
- store_artifacts :
@@ -59,22 +52,37 @@ jobs:
59
52
- run :
60
53
name : Nodejs Version
61
54
command : node --version
62
- - *restore_yarn_cache
63
- - *run_yarn
55
+ - restore_cache :
56
+ name : Restore yarn cache
57
+ key : v2-node-{{ arch }}-{{ checksum "yarn.lock" }}-yarn
58
+ - run :
59
+ name : Install Packages
60
+ command : yarn --frozen-lockfile --cache-folder ~/.cache/yarn
64
61
- save_cache :
65
- name : Save node_modules cache
66
- key : v2-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
62
+ # Store the yarn cache globally for all lock files with this same
63
+ # checksum. This will speed up the setup job for all PRs where the
64
+ # lockfile is the same.
65
+ name : Save yarn cache for future installs
66
+ key : v2-node-{{ arch }}-{{ checksum "yarn.lock" }}-yarn
67
67
paths :
68
68
- ~/.cache/yarn
69
+ - save_cache :
70
+ # Store node_modules for all jobs in this workflow so that they don't
71
+ # need to each run a yarn install for each job. This will speed up
72
+ # all jobs run on this branch with the same lockfile.
73
+ name : Save node_modules cache
74
+ # This cache key is per branch, a yarn install in setup is required.
75
+ key : v2-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}-node-modules
76
+ paths :
77
+ - node_modules
69
78
70
79
yarn_lint :
71
80
docker : *docker
72
81
environment : *environment
73
82
74
83
steps :
75
84
- checkout
76
- - *restore_yarn_cache
77
- - *run_yarn
85
+ - *restore_node_modules
78
86
- run : node ./scripts/prettier/index
79
87
- run : node ./scripts/tasks/eslint
80
88
- run : ./scripts/circleci/check_license.sh
87
95
88
96
steps :
89
97
- checkout
90
- - *restore_yarn_cache
91
- - *run_yarn
98
+ - *restore_node_modules
92
99
- run : node ./scripts/tasks/flow-ci
93
100
94
101
RELEASE_CHANNEL_stable_yarn_test :
98
105
99
106
steps :
100
107
- checkout
101
- - *restore_yarn_cache
102
- - *run_yarn
108
+ - *restore_node_modules
103
109
- run : yarn test --release-channel=stable --ci
104
110
105
111
yarn_test :
@@ -108,8 +114,7 @@ jobs:
108
114
parallelism : *TEST_PARALLELISM
109
115
steps :
110
116
- checkout
111
- - *restore_yarn_cache
112
- - *run_yarn
117
+ - *restore_node_modules
113
118
- run : yarn test --ci
114
119
115
120
RELEASE_CHANNEL_stable_yarn_test_www :
@@ -118,8 +123,7 @@ jobs:
118
123
parallelism : *TEST_PARALLELISM
119
124
steps :
120
125
- checkout
121
- - *restore_yarn_cache
122
- - *run_yarn
126
+ - *restore_node_modules
123
127
- run : yarn test --release-channel=www-classic --ci
124
128
125
129
RELEASE_CHANNEL_stable_yarn_test_www_variant :
@@ -128,8 +132,7 @@ jobs:
128
132
parallelism : *TEST_PARALLELISM
129
133
steps :
130
134
- checkout
131
- - *restore_yarn_cache
132
- - *run_yarn
135
+ - *restore_node_modules
133
136
- run : yarn test --release-channel=www-classic --variant --ci
134
137
135
138
RELEASE_CHANNEL_stable_yarn_test_prod_www :
@@ -138,8 +141,7 @@ jobs:
138
141
parallelism : *TEST_PARALLELISM
139
142
steps :
140
143
- checkout
141
- - *restore_yarn_cache
142
- - *run_yarn
144
+ - *restore_node_modules
143
145
- run : yarn test --release-channel=www-classic --prod --ci
144
146
145
147
RELEASE_CHANNEL_stable_yarn_test_prod_www_variant :
@@ -148,8 +150,7 @@ jobs:
148
150
parallelism : *TEST_PARALLELISM
149
151
steps :
150
152
- checkout
151
- - *restore_yarn_cache
152
- - *run_yarn
153
+ - *restore_node_modules
153
154
- run : yarn test --release-channel=www-classic --prod --variant --ci
154
155
155
156
yarn_test_www :
@@ -158,8 +159,7 @@ jobs:
158
159
parallelism : *TEST_PARALLELISM
159
160
steps :
160
161
- checkout
161
- - *restore_yarn_cache
162
- - *run_yarn
162
+ - *restore_node_modules
163
163
- run : yarn test --release-channel=www-modern --ci
164
164
165
165
yarn_test_www_variant :
@@ -168,8 +168,7 @@ jobs:
168
168
parallelism : *TEST_PARALLELISM
169
169
steps :
170
170
- checkout
171
- - *restore_yarn_cache
172
- - *run_yarn
171
+ - *restore_node_modules
173
172
- run : yarn test --release-channel=www-modern --variant --ci
174
173
175
174
yarn_test_prod_www :
@@ -178,8 +177,7 @@ jobs:
178
177
parallelism : *TEST_PARALLELISM
179
178
steps :
180
179
- checkout
181
- - *restore_yarn_cache
182
- - *run_yarn
180
+ - *restore_node_modules
183
181
- run : yarn test --release-channel=www-modern --prod --ci
184
182
185
183
yarn_test_prod_www_variant :
@@ -188,8 +186,7 @@ jobs:
188
186
parallelism : *TEST_PARALLELISM
189
187
steps :
190
188
- checkout
191
- - *restore_yarn_cache
192
- - *run_yarn
189
+ - *restore_node_modules
193
190
- run : yarn test --release-channel=www-modern --prod --variant --ci
194
191
195
192
RELEASE_CHANNEL_stable_yarn_test_persistent :
@@ -199,8 +196,7 @@ jobs:
199
196
200
197
steps :
201
198
- checkout
202
- - *restore_yarn_cache
203
- - *run_yarn
199
+ - *restore_node_modules
204
200
- run : yarn test --release-channel=stable --persistent --ci
205
201
206
202
RELEASE_CHANNEL_stable_yarn_test_prod :
@@ -210,8 +206,7 @@ jobs:
210
206
211
207
steps :
212
208
- checkout
213
- - *restore_yarn_cache
214
- - *run_yarn
209
+ - *restore_node_modules
215
210
- run : yarn test --release-channel=stable --prod --ci
216
211
217
212
yarn_test_prod :
@@ -220,8 +215,7 @@ jobs:
220
215
parallelism : *TEST_PARALLELISM
221
216
steps :
222
217
- checkout
223
- - *restore_yarn_cache
224
- - *run_yarn
218
+ - *restore_node_modules
225
219
- run : yarn test --release-channel=experimental --prod --ci
226
220
227
221
RELEASE_CHANNEL_stable_yarn_build :
@@ -230,8 +224,7 @@ jobs:
230
224
parallelism : *TEST_PARALLELISM
231
225
steps :
232
226
- checkout
233
- - *restore_yarn_cache
234
- - *run_yarn
227
+ - *restore_node_modules
235
228
- run :
236
229
environment :
237
230
RELEASE_CHANNEL : stable
@@ -257,8 +250,7 @@ jobs:
257
250
parallelism : 20
258
251
steps :
259
252
- checkout
260
- - *restore_yarn_cache
261
- - *run_yarn
253
+ - *restore_node_modules
262
254
- run :
263
255
environment :
264
256
RELEASE_CHANNEL : experimental
@@ -285,8 +277,7 @@ jobs:
285
277
steps :
286
278
- checkout
287
279
- attach_workspace : *attach_workspace
288
- - *restore_yarn_cache
289
- - *run_yarn
280
+ - *restore_node_modules
290
281
- run :
291
282
environment :
292
283
RELEASE_CHANNEL : experimental
@@ -305,8 +296,7 @@ jobs:
305
296
steps :
306
297
- checkout
307
298
- attach_workspace : *attach_workspace
308
- - *restore_yarn_cache
309
- - *run_yarn
299
+ - *restore_node_modules
310
300
# This runs in the process_artifacts job, too, but it's faster to run
311
301
# this step in both jobs instead of running the jobs sequentially
312
302
- run : node ./scripts/rollup/consolidateBundleSizes.js
@@ -321,8 +311,7 @@ jobs:
321
311
steps :
322
312
- checkout
323
313
- attach_workspace : *attach_workspace
324
- - *restore_yarn_cache
325
- - *run_yarn
314
+ - *restore_node_modules
326
315
# This runs in the process_artifacts job, too, but it's faster to run
327
316
# this step in both jobs instead of running the jobs sequentially
328
317
- run : node ./scripts/rollup/consolidateBundleSizes.js
@@ -337,8 +326,7 @@ jobs:
337
326
steps :
338
327
- checkout
339
328
- attach_workspace : *attach_workspace
340
- - *restore_yarn_cache
341
- - *run_yarn
329
+ - *restore_node_modules
342
330
- run : yarn lint-build
343
331
- run : scripts/circleci/check_minified_errors.sh
344
332
@@ -348,8 +336,7 @@ jobs:
348
336
steps :
349
337
- checkout
350
338
- attach_workspace : *attach_workspace
351
- - *restore_yarn_cache
352
- - *run_yarn
339
+ - *restore_node_modules
353
340
- run :
354
341
environment :
355
342
RELEASE_CHANNEL : stable
@@ -363,8 +350,7 @@ jobs:
363
350
steps :
364
351
- checkout
365
352
- attach_workspace : *attach_workspace
366
- - *restore_yarn_cache
367
- - *run_yarn
353
+ - *restore_node_modules
368
354
- run : yarn test --release-channel=stable --build --ci
369
355
370
356
yarn_test_build :
@@ -374,8 +360,7 @@ jobs:
374
360
steps :
375
361
- checkout
376
362
- attach_workspace : *attach_workspace
377
- - *restore_yarn_cache
378
- - *run_yarn
363
+ - *restore_node_modules
379
364
- run : yarn test --release-channel=experimental --build --ci
380
365
381
366
yarn_test_build_devtools :
@@ -384,8 +369,7 @@ jobs:
384
369
steps :
385
370
- checkout
386
371
- attach_workspace : *attach_workspace
387
- - *restore_yarn_cache
388
- - *run_yarn
372
+ - *restore_node_modules
389
373
- run : yarn test --project=devtools --build --ci
390
374
391
375
RELEASE_CHANNEL_stable_yarn_test_dom_fixtures :
@@ -394,7 +378,7 @@ jobs:
394
378
steps :
395
379
- checkout
396
380
- attach_workspace : *attach_workspace
397
- - *restore_yarn_cache
381
+ - *restore_node_modules
398
382
- run :
399
383
name : Run DOM fixture tests
400
384
environment :
@@ -410,8 +394,7 @@ jobs:
410
394
environment : *environment
411
395
steps :
412
396
- checkout
413
- - *restore_yarn_cache
414
- - *run_yarn
397
+ - *restore_node_modules
415
398
- run :
416
399
name : Run fuzz tests
417
400
command : |
@@ -425,8 +408,7 @@ jobs:
425
408
steps :
426
409
- checkout
427
410
- attach_workspace : *attach_workspace
428
- - *restore_yarn_cache
429
- - *run_yarn
411
+ - *restore_node_modules
430
412
- run : yarn test --release-channel=stable --build --prod --ci
431
413
432
414
yarn_test_build_prod :
@@ -436,8 +418,7 @@ jobs:
436
418
steps :
437
419
- checkout
438
420
- attach_workspace : *attach_workspace
439
- - *restore_yarn_cache
440
- - *run_yarn
421
+ - *restore_node_modules
441
422
- run : yarn test --release-channel=experimental --build --prod --ci
442
423
443
424
workflows :
0 commit comments