[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.
This commit is contained in:
Lauren Tan
2025-03-20 12:11:29 -04:00
parent cdeef1a0b3
commit a1cbfcdbdf
+15 -6
View File
@@ -144,6 +144,7 @@ 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
@@ -171,6 +172,7 @@ 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
@@ -200,6 +202,7 @@ 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
@@ -258,6 +261,7 @@ 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
- name: Ensure clean build directory
run: rm -rf build
- run: yarn install --frozen-lockfile
@@ -299,6 +303,7 @@ 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
- name: Ensure clean build directory
run: rm -rf build
- run: yarn install --frozen-lockfile
@@ -380,6 +385,7 @@ 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
- name: Ensure clean build directory
run: rm -rf build
- run: yarn install --frozen-lockfile
@@ -416,6 +422,7 @@ 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
@@ -466,6 +473,7 @@ 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
@@ -503,6 +511,7 @@ 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
@@ -536,7 +545,7 @@ jobs:
with:
path: |
**/node_modules
key: fixtures_dom-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
key: fixtures_dom-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'fixtures/dom/yarn.lock') }}
- name: Ensure clean build directory
run: rm -rf build
- run: yarn --cwd fixtures/dom install --frozen-lockfile
@@ -580,7 +589,7 @@ jobs:
with:
path: |
**/node_modules
key: fixtures_flight-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
key: fixtures_flight-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'fixtures/flight/yarn.lock') }}
- name: Ensure clean build directory
run: rm -rf build
- run: yarn install --frozen-lockfile
@@ -655,6 +664,7 @@ 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
@@ -709,6 +719,7 @@ 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
@@ -730,7 +741,7 @@ jobs:
sizebot:
if: ${{ github.event_name == 'pull_request' && github.ref_name != 'main' && github.event.pull_request.base.ref == 'main' }}
name: Run sizebot
needs: [build_and_lint, runtime_node_modules_cache]
needs: [build_and_lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -742,7 +753,7 @@ jobs:
cache: yarn
cache-dependency-path: yarn.lock
- name: Restore cached node_modules
uses: actions/cache/restore@v4
uses: actions/cache@v4 # note: this does not reuse centralized cache since it has unique cache key
id: node_modules
with:
path: |
@@ -768,8 +779,6 @@ jobs:
run: ls -R base-build
- name: Ensure clean build directory
run: rm -rf build
- run: yarn install --frozen-lockfile
if: steps.node_modules.outputs.cache-hit != 'true'
- name: Restore archived build for PR
uses: actions/download-artifact@v4
with: