Skip to content

Commit 2e85e07

Browse files
committed
ci: include runner arch in cache keys to prevent restore time conflation
1 parent 9695553 commit 2e85e07

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ jobs:
3636
uses: nix-community/cache-nix-action@v6
3737
id: nix-cache
3838
with:
39-
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
40-
restore-prefixes-first-match: nix-${{ runner.os }}-
39+
primary-key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
40+
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}-
4141
gc-max-store-size-linux: 5368709000
4242
purge: true
43-
purge-prefixes: nix-${{ runner.os }}-
43+
purge-prefixes: nix-${{ runner.os }}-${{ runner.arch }}-
4444
purge-created: 0
4545
purge-primary-key: never
4646

4747
- name: Restore and cache build data
4848
uses: actions/cache@v4
4949
with:
5050
path: ./target/
51-
key: rust-build-${{ runner.os }}-${{ hashFiles('Cargo.toml', 'Cargo.lock', 'rust-toolchain') }}
51+
key: rust-build-${{ runner.os }}-$${{ runner.arch }}-{{ hashFiles('Cargo.toml', 'Cargo.lock', 'rust-toolchain') }}
5252

5353
- name: Lint rust
5454
run: nix develop -c bash -c 'mkdir www/build && cargo clippy && cargo deny check --hide-inclusion-graph && cargo fmt --check'
@@ -83,18 +83,18 @@ jobs:
8383
uses: nix-community/cache-nix-action@v6
8484
with:
8585
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
86-
restore-prefixes-first-match: nix-${{ runner.os }}-
86+
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}-
8787
gc-max-store-size-linux: 5368709000
8888
purge: true
89-
purge-prefixes: nix-${{ runner.os }}-
89+
purge-prefixes: nix-${{ runner.os }}-${{ runner.arch }}-
9090
purge-created: 0
9191
purge-primary-key: never
9292

9393
- name: Restore and cache build data
9494
uses: actions/cache@v4
9595
with:
9696
path: ./target/
97-
key: rust-build-${{ runner.os }}-${{ hashFiles('Cargo.toml', 'Cargo.lock', 'rust-toolchain') }}
97+
key: rust-build-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.toml', 'Cargo.lock', 'rust-toolchain') }}
9898

9999
- name: Build web
100100
run: nix develop -c bash -c 'cd www && bun install --locked && bun run build'

0 commit comments

Comments
 (0)