Skip to content

Commit 74bcf3d

Browse files
authored
[ci] Don't fail on cache miss (#32690)
Partially reverts #32686. PR caches inherit from caches generated in `main`. If it cannot find that cache, it will create one scoped to just that PR (and PRs that inherit from it). There is an edge case where cache eviction can happen in the middle of a test run. If cache eviction removes a `main` cache, child jobs that depend on it will start failing because of the `fail-on-cache-miss` setting. This PR reverts the default behavior. If this happens, the workflow will still continue in slow mode where it will `yarn install` child jobs instead of reusing from cache. This is slower but will at least allow workflows to continue. Additionally I added restore keys so that we can fallback to other caches if present so `yarn install` doesn't need to start over from scratch.
1 parent b630219 commit 74bcf3d

File tree

1 file changed

+30
-11
lines changed

1 file changed

+30
-11
lines changed

.github/workflows/runtime_build_and_test.yml

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ jobs:
147147
path: |
148148
**/node_modules
149149
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
150-
fail-on-cache-miss: true
150+
restore-keys: |
151+
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
152+
runtime-node_modules-v6-
151153
- name: Ensure clean build directory
152154
run: rm -rf build
153155
- run: yarn install --frozen-lockfile
@@ -175,7 +177,9 @@ jobs:
175177
path: |
176178
**/node_modules
177179
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
178-
fail-on-cache-miss: true
180+
restore-keys: |
181+
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
182+
runtime-node_modules-v6-
179183
- name: Ensure clean build directory
180184
run: rm -rf build
181185
- run: yarn install --frozen-lockfile
@@ -205,7 +209,6 @@ jobs:
205209
path: |
206210
**/node_modules
207211
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
208-
fail-on-cache-miss: true
209212
- name: Ensure clean build directory
210213
run: rm -rf build
211214
- run: yarn install --frozen-lockfile
@@ -264,7 +267,9 @@ jobs:
264267
path: |
265268
**/node_modules
266269
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
267-
fail-on-cache-miss: true
270+
restore-keys: |
271+
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
272+
runtime-and-compiler-node_modules-v6-
268273
- name: Ensure clean build directory
269274
run: rm -rf build
270275
- run: yarn install --frozen-lockfile
@@ -306,7 +311,9 @@ jobs:
306311
path: |
307312
**/node_modules
308313
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
309-
fail-on-cache-miss: true
314+
restore-keys: |
315+
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
316+
runtime-and-compiler-node_modules-v6-
310317
- name: Ensure clean build directory
311318
run: rm -rf build
312319
- run: yarn install --frozen-lockfile
@@ -388,7 +395,9 @@ jobs:
388395
path: |
389396
**/node_modules
390397
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
391-
fail-on-cache-miss: true
398+
restore-keys: |
399+
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
400+
runtime-and-compiler-node_modules-v6-
392401
- name: Ensure clean build directory
393402
run: rm -rf build
394403
- run: yarn install --frozen-lockfile
@@ -425,7 +434,9 @@ jobs:
425434
path: |
426435
**/node_modules
427436
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
428-
fail-on-cache-miss: true
437+
restore-keys: |
438+
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
439+
runtime-node_modules-v6-
429440
- name: Ensure clean build directory
430441
run: rm -rf build
431442
- run: yarn install --frozen-lockfile
@@ -476,7 +487,9 @@ jobs:
476487
path: |
477488
**/node_modules
478489
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
479-
fail-on-cache-miss: true
490+
restore-keys: |
491+
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
492+
runtime-node_modules-v6-
480493
- name: Ensure clean build directory
481494
run: rm -rf build
482495
- run: yarn install --frozen-lockfile
@@ -514,7 +527,9 @@ jobs:
514527
path: |
515528
**/node_modules
516529
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
517-
fail-on-cache-miss: true
530+
restore-keys: |
531+
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
532+
runtime-node_modules-v6-
518533
- name: Ensure clean build directory
519534
run: rm -rf build
520535
- run: yarn install --frozen-lockfile
@@ -664,7 +679,9 @@ jobs:
664679
path: |
665680
**/node_modules
666681
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
667-
fail-on-cache-miss: true
682+
restore-keys: |
683+
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
684+
runtime-node_modules-v6-
668685
- name: Ensure clean build directory
669686
run: rm -rf build
670687
- run: yarn install --frozen-lockfile
@@ -719,7 +736,9 @@ jobs:
719736
path: |
720737
**/node_modules
721738
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
722-
fail-on-cache-miss: true
739+
restore-keys: |
740+
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
741+
runtime-node_modules-v6-
723742
- name: Ensure clean build directory
724743
run: rm -rf build
725744
- run: yarn install --frozen-lockfile

0 commit comments

Comments
 (0)