Skip to content

Commit 3950c18

Browse files
committed
Speed up yarn cache in circle
1 parent 0cd9a6d commit 3950c18

File tree

1 file changed

+14
-40
lines changed

1 file changed

+14
-40
lines changed

.circleci/config.yml

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ aliases:
1111
restore_cache:
1212
name: Restore node_modules cache
1313
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
2115

2216
- &TEST_PARALLELISM 20
2317

@@ -31,7 +25,6 @@ aliases:
3125
- checkout
3226
- attach_workspace: *attach_workspace
3327
- *restore_yarn_cache
34-
- *run_yarn
3528
- run: node ./scripts/rollup/consolidateBundleSizes.js
3629
- run: ./scripts/circleci/pack_and_store_artifact.sh
3730
- store_artifacts:
@@ -59,13 +52,22 @@ jobs:
5952
- run:
6053
name: Nodejs Version
6154
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
6461
- save_cache:
65-
name: Save node_modules cache
66-
key: v2-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}
62+
name: Save yarn cache
63+
key: v2-node-{{ arch }}-{{ checksum "yarn.lock" }}-yarn
6764
paths:
6865
- ~/.cache/yarn
66+
- save_cache:
67+
name: Save node_modules cache
68+
key: v2-node-{{ arch }}-{{ .Branch }}-{{ checksum "yarn.lock" }}-node-modules
69+
paths:
70+
- node_modules
6971

7072
yarn_lint:
7173
docker: *docker
@@ -74,7 +76,6 @@ jobs:
7476
steps:
7577
- checkout
7678
- *restore_yarn_cache
77-
- *run_yarn
7879
- run: node ./scripts/prettier/index
7980
- run: node ./scripts/tasks/eslint
8081
- run: ./scripts/circleci/check_license.sh
@@ -88,7 +89,6 @@ jobs:
8889
steps:
8990
- checkout
9091
- *restore_yarn_cache
91-
- *run_yarn
9292
- run: node ./scripts/tasks/flow-ci
9393

9494
RELEASE_CHANNEL_stable_yarn_test:
@@ -99,7 +99,6 @@ jobs:
9999
steps:
100100
- checkout
101101
- *restore_yarn_cache
102-
- *run_yarn
103102
- run: yarn test --release-channel=stable --ci
104103

105104
yarn_test:
@@ -109,7 +108,6 @@ jobs:
109108
steps:
110109
- checkout
111110
- *restore_yarn_cache
112-
- *run_yarn
113111
- run: yarn test --ci
114112

115113
RELEASE_CHANNEL_stable_yarn_test_www:
@@ -119,7 +117,6 @@ jobs:
119117
steps:
120118
- checkout
121119
- *restore_yarn_cache
122-
- *run_yarn
123120
- run: yarn test --release-channel=www-classic --ci
124121

125122
RELEASE_CHANNEL_stable_yarn_test_www_variant:
@@ -129,7 +126,6 @@ jobs:
129126
steps:
130127
- checkout
131128
- *restore_yarn_cache
132-
- *run_yarn
133129
- run: yarn test --release-channel=www-classic --variant --ci
134130

135131
RELEASE_CHANNEL_stable_yarn_test_prod_www:
@@ -139,7 +135,6 @@ jobs:
139135
steps:
140136
- checkout
141137
- *restore_yarn_cache
142-
- *run_yarn
143138
- run: yarn test --release-channel=www-classic --prod --ci
144139

145140
RELEASE_CHANNEL_stable_yarn_test_prod_www_variant:
@@ -149,7 +144,6 @@ jobs:
149144
steps:
150145
- checkout
151146
- *restore_yarn_cache
152-
- *run_yarn
153147
- run: yarn test --release-channel=www-classic --prod --variant --ci
154148

155149
yarn_test_www:
@@ -159,7 +153,6 @@ jobs:
159153
steps:
160154
- checkout
161155
- *restore_yarn_cache
162-
- *run_yarn
163156
- run: yarn test --release-channel=www-modern --ci
164157

165158
yarn_test_www_variant:
@@ -169,7 +162,6 @@ jobs:
169162
steps:
170163
- checkout
171164
- *restore_yarn_cache
172-
- *run_yarn
173165
- run: yarn test --release-channel=www-modern --variant --ci
174166

175167
yarn_test_prod_www:
@@ -179,7 +171,6 @@ jobs:
179171
steps:
180172
- checkout
181173
- *restore_yarn_cache
182-
- *run_yarn
183174
- run: yarn test --release-channel=www-modern --prod --ci
184175

185176
yarn_test_prod_www_variant:
@@ -189,7 +180,6 @@ jobs:
189180
steps:
190181
- checkout
191182
- *restore_yarn_cache
192-
- *run_yarn
193183
- run: yarn test --release-channel=www-modern --prod --variant --ci
194184

195185
RELEASE_CHANNEL_stable_yarn_test_persistent:
@@ -200,7 +190,6 @@ jobs:
200190
steps:
201191
- checkout
202192
- *restore_yarn_cache
203-
- *run_yarn
204193
- run: yarn test --release-channel=stable --persistent --ci
205194

206195
RELEASE_CHANNEL_stable_yarn_test_prod:
@@ -211,7 +200,6 @@ jobs:
211200
steps:
212201
- checkout
213202
- *restore_yarn_cache
214-
- *run_yarn
215203
- run: yarn test --release-channel=stable --prod --ci
216204

217205
yarn_test_prod:
@@ -221,7 +209,6 @@ jobs:
221209
steps:
222210
- checkout
223211
- *restore_yarn_cache
224-
- *run_yarn
225212
- run: yarn test --release-channel=experimental --prod --ci
226213

227214
RELEASE_CHANNEL_stable_yarn_build:
@@ -231,7 +218,6 @@ jobs:
231218
steps:
232219
- checkout
233220
- *restore_yarn_cache
234-
- *run_yarn
235221
- run:
236222
environment:
237223
RELEASE_CHANNEL: stable
@@ -258,7 +244,6 @@ jobs:
258244
steps:
259245
- checkout
260246
- *restore_yarn_cache
261-
- *run_yarn
262247
- run:
263248
environment:
264249
RELEASE_CHANNEL: experimental
@@ -286,7 +271,6 @@ jobs:
286271
- checkout
287272
- attach_workspace: *attach_workspace
288273
- *restore_yarn_cache
289-
- *run_yarn
290274
- run:
291275
environment:
292276
RELEASE_CHANNEL: experimental
@@ -306,7 +290,6 @@ jobs:
306290
- checkout
307291
- attach_workspace: *attach_workspace
308292
- *restore_yarn_cache
309-
- *run_yarn
310293
# This runs in the process_artifacts job, too, but it's faster to run
311294
# this step in both jobs instead of running the jobs sequentially
312295
- run: node ./scripts/rollup/consolidateBundleSizes.js
@@ -322,7 +305,6 @@ jobs:
322305
- checkout
323306
- attach_workspace: *attach_workspace
324307
- *restore_yarn_cache
325-
- *run_yarn
326308
# This runs in the process_artifacts job, too, but it's faster to run
327309
# this step in both jobs instead of running the jobs sequentially
328310
- run: node ./scripts/rollup/consolidateBundleSizes.js
@@ -338,7 +320,6 @@ jobs:
338320
- checkout
339321
- attach_workspace: *attach_workspace
340322
- *restore_yarn_cache
341-
- *run_yarn
342323
- run: yarn lint-build
343324
- run: scripts/circleci/check_minified_errors.sh
344325

@@ -349,7 +330,6 @@ jobs:
349330
- checkout
350331
- attach_workspace: *attach_workspace
351332
- *restore_yarn_cache
352-
- *run_yarn
353333
- run:
354334
environment:
355335
RELEASE_CHANNEL: stable
@@ -364,7 +344,6 @@ jobs:
364344
- checkout
365345
- attach_workspace: *attach_workspace
366346
- *restore_yarn_cache
367-
- *run_yarn
368347
- run: yarn test --release-channel=stable --build --ci
369348

370349
yarn_test_build:
@@ -375,7 +354,6 @@ jobs:
375354
- checkout
376355
- attach_workspace: *attach_workspace
377356
- *restore_yarn_cache
378-
- *run_yarn
379357
- run: yarn test --release-channel=experimental --build --ci
380358

381359
yarn_test_build_devtools:
@@ -385,7 +363,6 @@ jobs:
385363
- checkout
386364
- attach_workspace: *attach_workspace
387365
- *restore_yarn_cache
388-
- *run_yarn
389366
- run: yarn test --project=devtools --build --ci
390367

391368
RELEASE_CHANNEL_stable_yarn_test_dom_fixtures:
@@ -411,7 +388,6 @@ jobs:
411388
steps:
412389
- checkout
413390
- *restore_yarn_cache
414-
- *run_yarn
415391
- run:
416392
name: Run fuzz tests
417393
command: |
@@ -426,7 +402,6 @@ jobs:
426402
- checkout
427403
- attach_workspace: *attach_workspace
428404
- *restore_yarn_cache
429-
- *run_yarn
430405
- run: yarn test --release-channel=stable --build --prod --ci
431406

432407
yarn_test_build_prod:
@@ -437,7 +412,6 @@ jobs:
437412
- checkout
438413
- attach_workspace: *attach_workspace
439414
- *restore_yarn_cache
440-
- *run_yarn
441415
- run: yarn test --release-channel=experimental --build --prod --ci
442416

443417
workflows:

0 commit comments

Comments
 (0)