Skip to content

Commit 1bcfa03

Browse files
committed
[ci] Cache runtime and compiler only for test runs
We only need the compiler built for `yarn test` in the root directory. Rather than always cache both for every step, let's just do it where it's needed explicitly.
1 parent 64d5524 commit 1bcfa03

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

Diff for: .github/workflows/runtime_build_and_test.yml

+24-16
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
id: node_modules
5757
with:
5858
path: "**/node_modules"
59-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
59+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
6060
- name: Ensure clean build directory
6161
run: rm -rf build
6262
- run: yarn install --frozen-lockfile
@@ -80,7 +80,7 @@ jobs:
8080
id: node_modules
8181
with:
8282
path: "**/node_modules"
83-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
83+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
8484
- name: Ensure clean build directory
8585
run: rm -rf build
8686
- run: yarn install --frozen-lockfile
@@ -106,7 +106,7 @@ jobs:
106106
id: node_modules
107107
with:
108108
path: "**/node_modules"
109-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
109+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
110110
- name: Ensure clean build directory
111111
run: rm -rf build
112112
- run: yarn install --frozen-lockfile
@@ -153,16 +153,20 @@ jobs:
153153
with:
154154
node-version-file: '.nvmrc'
155155
cache: yarn
156-
cache-dependency-path: yarn.lock
156+
cache-dependency-path: |
157+
yarn.lock
158+
compiler/yarn.lock
157159
- name: Restore cached node_modules
158160
uses: actions/cache@v4
159161
id: node_modules
160162
with:
161163
path: "**/node_modules"
162-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
164+
key: runtime-and-compiler-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
163165
- name: Ensure clean build directory
164166
run: rm -rf build
165167
- run: yarn install --frozen-lockfile
168+
- run: yarn install --frozen-lockfile
169+
working-directory: compiler
166170
- run: yarn test ${{ matrix.params }} --ci --shard=${{ matrix.shard }}
167171

168172
# ----- BUILD -----
@@ -193,7 +197,7 @@ jobs:
193197
id: node_modules
194198
with:
195199
path: "**/node_modules"
196-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
200+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
197201
- name: Ensure clean build directory
198202
run: rm -rf build
199203
- run: yarn install --frozen-lockfile
@@ -261,16 +265,20 @@ jobs:
261265
with:
262266
node-version-file: '.nvmrc'
263267
cache: yarn
264-
cache-dependency-path: yarn.lock
268+
cache-dependency-path: |
269+
yarn.lock
270+
compiler/yarn.lock
265271
- name: Restore cached node_modules
266272
uses: actions/cache@v4
267273
id: node_modules
268274
with:
269275
path: "**/node_modules"
270-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
276+
key: runtime-and-compiler-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
271277
- name: Ensure clean build directory
272278
run: rm -rf build
273279
- run: yarn install --frozen-lockfile
280+
- run: yarn install --frozen-lockfile
281+
working-directory: compiler
274282
- name: Restore archived build
275283
uses: actions/download-artifact@v4
276284
with:
@@ -299,7 +307,7 @@ jobs:
299307
id: node_modules
300308
with:
301309
path: "**/node_modules"
302-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
310+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
303311
- name: Ensure clean build directory
304312
run: rm -rf build
305313
- run: yarn install --frozen-lockfile
@@ -346,7 +354,7 @@ jobs:
346354
id: node_modules
347355
with:
348356
path: "**/node_modules"
349-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
357+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
350358
- name: Ensure clean build directory
351359
run: rm -rf build
352360
- run: yarn install --frozen-lockfile
@@ -381,7 +389,7 @@ jobs:
381389
id: node_modules
382390
with:
383391
path: "**/node_modules"
384-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
392+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
385393
- name: Ensure clean build directory
386394
run: rm -rf build
387395
- run: yarn install --frozen-lockfile
@@ -413,7 +421,7 @@ jobs:
413421
id: node_modules
414422
with:
415423
path: "**/node_modules"
416-
key: fixtures_dom-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
424+
key: fixtures_dom-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
417425
- name: Ensure clean build directory
418426
run: rm -rf build
419427
- run: yarn install --frozen-lockfile
@@ -456,7 +464,7 @@ jobs:
456464
id: node_modules
457465
with:
458466
path: "**/node_modules"
459-
key: fixtures_flight-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
467+
key: fixtures_flight-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
460468
- name: Ensure clean build directory
461469
run: rm -rf build
462470
- run: yarn install --frozen-lockfile
@@ -518,7 +526,7 @@ jobs:
518526
id: node_modules
519527
with:
520528
path: "**/node_modules"
521-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
529+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
522530
- name: Ensure clean build directory
523531
run: rm -rf build
524532
- run: yarn install --frozen-lockfile
@@ -569,7 +577,7 @@ jobs:
569577
id: node_modules
570578
with:
571579
path: "**/node_modules"
572-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
580+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
573581
- name: Ensure clean build directory
574582
run: rm -rf build
575583
- run: yarn install --frozen-lockfile
@@ -606,7 +614,7 @@ jobs:
606614
id: node_modules
607615
with:
608616
path: "**/node_modules"
609-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
617+
key: runtime-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
610618
- name: Ensure clean build directory
611619
run: rm -rf build
612620
- run: yarn install --frozen-lockfile

Diff for: .github/workflows/runtime_eslint_plugin_e2e.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,20 @@ jobs:
3535
with:
3636
node-version-file: '.nvmrc'
3737
cache: yarn
38-
cache-dependency-path: yarn.lock
38+
cache-dependency-path: |
39+
yarn.lock
40+
compiler/yarn.lock
3941
- name: Restore cached node_modules
4042
uses: actions/cache@v4
4143
id: node_modules
4244
with:
4345
path: "node_modules"
44-
key: runtime-eslint_e2e-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
46+
key: runtime-and-compiler-eslint_e2e-node_modules-v3-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
4547
- name: Ensure clean build directory
4648
run: rm -rf build
4749
- run: yarn install --frozen-lockfile
50+
- run: yarn install --frozen-lockfile
51+
working-directory: compiler
4852
- name: Build plugin
4953
working-directory: fixtures/eslint-v${{ matrix.eslint_major }}
5054
run: node build.mjs

0 commit comments

Comments
 (0)