@samitouri / QOS-React / commits / 74bcf3d0d2

[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.

lauren committed Mar 20, 2025 at 17:02 UTC 74bcf3d0d2c34595e33838149d1d5a2ea7d783c6
1 file changed +30 -11
.github/workflows/runtime_build_and_test.yml
+30 -11
@@ -147,7 +147,9 @@ jobs:
147 path: |
148 **/node_modules
149 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-
153 - name: Ensure clean build directory
154 run: rm -rf build
155 - run: yarn install --frozen-lockfile
@@ -175,7 +177,9 @@ jobs:
177 path: |
178 **/node_modules
179 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-
183 - name: Ensure clean build directory
184 run: rm -rf build
185 - run: yarn install --frozen-lockfile
@@ -205,7 +209,6 @@ jobs:
209 path: |
210 **/node_modules
211 key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
208 - fail-on-cache-miss: true
212 - name: Ensure clean build directory
213 run: rm -rf build
214 - run: yarn install --frozen-lockfile
@@ -264,7 +267,9 @@ jobs:
267 path: |
268 **/node_modules
269 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-
273 - name: Ensure clean build directory
274 run: rm -rf build
275 - run: yarn install --frozen-lockfile
@@ -306,7 +311,9 @@ jobs:
311 path: |
312 **/node_modules
313 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-
317 - name: Ensure clean build directory
318 run: rm -rf build
319 - run: yarn install --frozen-lockfile
@@ -388,7 +395,9 @@ jobs:
395 path: |
396 **/node_modules
397 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-
401 - name: Ensure clean build directory
402 run: rm -rf build
403 - run: yarn install --frozen-lockfile
@@ -425,7 +434,9 @@ jobs:
434 path: |
435 **/node_modules
436 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-
440 - name: Ensure clean build directory
441 run: rm -rf build
442 - run: yarn install --frozen-lockfile
@@ -476,7 +487,9 @@ jobs:
487 path: |
488 **/node_modules
489 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-
493 - name: Ensure clean build directory
494 run: rm -rf build
495 - run: yarn install --frozen-lockfile
@@ -514,7 +527,9 @@ jobs:
527 path: |
528 **/node_modules
529 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-
533 - name: Ensure clean build directory
534 run: rm -rf build
535 - run: yarn install --frozen-lockfile
@@ -664,7 +679,9 @@ jobs:
679 path: |
680 **/node_modules
681 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-
685 - name: Ensure clean build directory
686 run: rm -rf build
687 - run: yarn install --frozen-lockfile
@@ -719,7 +736,9 @@ jobs:
736 path: |
737 **/node_modules
738 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-
742 - name: Ensure clean build directory
743 run: rm -rf build
744 - run: yarn install --frozen-lockfile