Skip to content

Commit a1cbfcd

Browse files
committed
[ci] Fail on cache miss
Since we use a centralized cache we should fail subsequent steps if the child jobs are unable to restore the cache from the first 2 jobs. Also fix some incorrect hashes used for the fixture tests.
1 parent cdeef1a commit a1cbfcd

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/runtime_build_and_test.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ jobs:
144144
path: |
145145
**/node_modules
146146
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
147+
fail-on-cache-miss: true
147148
- name: Ensure clean build directory
148149
run: rm -rf build
149150
- run: yarn install --frozen-lockfile
@@ -171,6 +172,7 @@ jobs:
171172
path: |
172173
**/node_modules
173174
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
175+
fail-on-cache-miss: true
174176
- name: Ensure clean build directory
175177
run: rm -rf build
176178
- run: yarn install --frozen-lockfile
@@ -200,6 +202,7 @@ jobs:
200202
path: |
201203
**/node_modules
202204
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
205+
fail-on-cache-miss: true
203206
- name: Ensure clean build directory
204207
run: rm -rf build
205208
- run: yarn install --frozen-lockfile
@@ -258,6 +261,7 @@ jobs:
258261
path: |
259262
**/node_modules
260263
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
264+
fail-on-cache-miss: true
261265
- name: Ensure clean build directory
262266
run: rm -rf build
263267
- run: yarn install --frozen-lockfile
@@ -299,6 +303,7 @@ jobs:
299303
path: |
300304
**/node_modules
301305
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
306+
fail-on-cache-miss: true
302307
- name: Ensure clean build directory
303308
run: rm -rf build
304309
- run: yarn install --frozen-lockfile
@@ -380,6 +385,7 @@ jobs:
380385
path: |
381386
**/node_modules
382387
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
388+
fail-on-cache-miss: true
383389
- name: Ensure clean build directory
384390
run: rm -rf build
385391
- run: yarn install --frozen-lockfile
@@ -416,6 +422,7 @@ jobs:
416422
path: |
417423
**/node_modules
418424
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
425+
fail-on-cache-miss: true
419426
- name: Ensure clean build directory
420427
run: rm -rf build
421428
- run: yarn install --frozen-lockfile
@@ -466,6 +473,7 @@ jobs:
466473
path: |
467474
**/node_modules
468475
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
476+
fail-on-cache-miss: true
469477
- name: Ensure clean build directory
470478
run: rm -rf build
471479
- run: yarn install --frozen-lockfile
@@ -503,6 +511,7 @@ jobs:
503511
path: |
504512
**/node_modules
505513
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
514+
fail-on-cache-miss: true
506515
- name: Ensure clean build directory
507516
run: rm -rf build
508517
- run: yarn install --frozen-lockfile
@@ -536,7 +545,7 @@ jobs:
536545
with:
537546
path: |
538547
**/node_modules
539-
key: fixtures_dom-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
548+
key: fixtures_dom-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'fixtures/dom/yarn.lock') }}
540549
- name: Ensure clean build directory
541550
run: rm -rf build
542551
- run: yarn --cwd fixtures/dom install --frozen-lockfile
@@ -580,7 +589,7 @@ jobs:
580589
with:
581590
path: |
582591
**/node_modules
583-
key: fixtures_flight-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
592+
key: fixtures_flight-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'fixtures/flight/yarn.lock') }}
584593
- name: Ensure clean build directory
585594
run: rm -rf build
586595
- run: yarn install --frozen-lockfile
@@ -655,6 +664,7 @@ jobs:
655664
path: |
656665
**/node_modules
657666
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
667+
fail-on-cache-miss: true
658668
- name: Ensure clean build directory
659669
run: rm -rf build
660670
- run: yarn install --frozen-lockfile
@@ -709,6 +719,7 @@ jobs:
709719
path: |
710720
**/node_modules
711721
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
722+
fail-on-cache-miss: true
712723
- name: Ensure clean build directory
713724
run: rm -rf build
714725
- run: yarn install --frozen-lockfile
@@ -730,7 +741,7 @@ jobs:
730741
sizebot:
731742
if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' && github.event.pull_request.base.ref == 'main' }}
732743
name: Run sizebot
733-
needs: [build_and_lint, runtime_node_modules_cache]
744+
needs: [build_and_lint]
734745
runs-on: ubuntu-latest
735746
steps:
736747
- uses: actions/checkout@v4
@@ -742,7 +753,7 @@ jobs:
742753
cache: yarn
743754
cache-dependency-path: yarn.lock
744755
- name: Restore cached node_modules
745-
uses: actions/cache/restore@v4
756+
uses: actions/cache@v4 # note: this does not reuse centralized cache since it has unique cache key
746757
id: node_modules
747758
with:
748759
path: |
@@ -768,8 +779,6 @@ jobs:
768779
run: ls -R base-build
769780
- name: Ensure clean build directory
770781
run: rm -rf build
771-
- run: yarn install --frozen-lockfile
772-
if: steps.node_modules.outputs.cache-hit != 'true'
773782
- name: Restore archived build for PR
774783
uses: actions/download-artifact@v4
775784
with:

0 commit comments

Comments
 (0)