Skip to content

Commit f67d031

Browse files
authored
ci: speed up workflow reruns, remove run_number from build cache key (#14448)
Use `${{ github.sha }}` instead of `${{ github.sha }}-${{ github.run_number }}` for the build cache key, which will speed up re-runs of failed workflows. This should avoid having to rebuild at all on a re-run, saving ~5mins.
1 parent 69408f0 commit f67d031

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
uses: actions/cache@v4
9292
with:
9393
path: ./*
94-
key: ${{ github.sha }}-${{ github.run_number }}
94+
key: ${{ github.sha }}
9595

9696
tests-unit:
9797
runs-on: ubuntu-24.04
@@ -110,7 +110,7 @@ jobs:
110110
uses: actions/cache@v4
111111
with:
112112
path: ./*
113-
key: ${{ github.sha }}-${{ github.run_number }}
113+
key: ${{ github.sha }}
114114

115115
- name: Unit Tests
116116
run: pnpm test:unit
@@ -134,7 +134,7 @@ jobs:
134134
uses: actions/cache@v4
135135
with:
136136
path: ./*
137-
key: ${{ github.sha }}-${{ github.run_number }}
137+
key: ${{ github.sha }}
138138

139139
- name: Types Tests
140140
run: pnpm test:types --target '>=5.7'
@@ -205,7 +205,7 @@ jobs:
205205
uses: actions/cache@v4
206206
with:
207207
path: ./*
208-
key: ${{ github.sha }}-${{ github.run_number }}
208+
key: ${{ github.sha }}
209209

210210
- name: Start LocalStack
211211
run: pnpm docker:start
@@ -342,7 +342,7 @@ jobs:
342342
uses: actions/cache@v4
343343
with:
344344
path: ./*
345-
key: ${{ github.sha }}-${{ github.run_number }}
345+
key: ${{ github.sha }}
346346

347347
- name: Start LocalStack
348348
run: pnpm docker:start
@@ -486,7 +486,7 @@ jobs:
486486
uses: actions/cache@v4
487487
with:
488488
path: ./*
489-
key: ${{ github.sha }}-${{ github.run_number }}
489+
key: ${{ github.sha }}
490490

491491
- name: Start LocalStack
492492
run: pnpm docker:start
@@ -586,7 +586,7 @@ jobs:
586586
uses: actions/cache@v4
587587
with:
588588
path: ./*
589-
key: ${{ github.sha }}-${{ github.run_number }}
589+
key: ${{ github.sha }}
590590

591591
- name: Start PostgreSQL
592592
uses: CasperWA/postgresql-action@v1.2
@@ -683,7 +683,7 @@ jobs:
683683
uses: actions/cache@v4
684684
with:
685685
path: ./*
686-
key: ${{ github.sha }}-${{ github.run_number }}
686+
key: ${{ github.sha }}
687687

688688
- name: Generate Payload Types
689689
run: pnpm dev:generate-types fields
@@ -742,7 +742,7 @@ jobs:
742742
uses: actions/cache@v4
743743
with:
744744
path: ./*
745-
key: ${{ github.sha }}-${{ github.run_number }}
745+
key: ${{ github.sha }}
746746

747747
- run: pnpm run build:bundle-for-analysis # Esbuild packages that haven't already been built in the build step for the purpose of analyzing bundle size
748748
env:

0 commit comments

Comments
 (0)