From 0ae1fc76a4dd23e89fdb9c553db36e54b22848ef Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Thu, 20 Mar 2025 16:54:38 -0400 Subject: [PATCH] [ci] Don't fail on cache miss 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. --- .github/workflows/runtime_build_and_test.yml | 41 ++++++++++++++------ 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/runtime_build_and_test.yml b/.github/workflows/runtime_build_and_test.yml index 165ddac43cd2..8d9dc7487e4f 100644 --- a/.github/workflows/runtime_build_and_test.yml +++ b/.github/workflows/runtime_build_and_test.yml @@ -147,7 +147,9 @@ jobs: path: | **/node_modules key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -175,7 +177,9 @@ jobs: path: | **/node_modules key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -205,7 +209,6 @@ jobs: path: | **/node_modules key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - fail-on-cache-miss: true - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -264,7 +267,9 @@ jobs: path: | **/node_modules key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-and-compiler-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -306,7 +311,9 @@ jobs: path: | **/node_modules key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-and-compiler-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -388,7 +395,9 @@ jobs: path: | **/node_modules key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-and-compiler-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -425,7 +434,9 @@ jobs: path: | **/node_modules key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -476,7 +487,9 @@ jobs: path: | **/node_modules key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -514,7 +527,9 @@ jobs: path: | **/node_modules key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -664,7 +679,9 @@ jobs: path: | **/node_modules key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile @@ -719,7 +736,9 @@ jobs: path: | **/node_modules key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - fail-on-cache-miss: true + restore-keys: | + runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}- + runtime-node_modules-v6- - name: Ensure clean build directory run: rm -rf build - run: yarn install --frozen-lockfile