Skip to content

Commit 450bdd7

Browse files
committed
fix(ci): add python-version to cache key for parallel jobs
Separate cache keys per Python version to prevent cache overwrites when matrix jobs run in parallel. Default to python311 since it matches the default devShell.
1 parent 2c303dc commit 450bdd7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/actions/setup-nix/action.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: "Setup Nix"
22
description: "Install Nix and configure cache"
3+
inputs:
4+
python-version:
5+
description: "Python version for cache key (e.g., python311, python313)"
6+
required: false
7+
default: "python311"
38
runs:
49
using: "composite"
510
steps:
@@ -11,5 +16,7 @@ runs:
1116
- name: Cache Nix store
1217
uses: nix-community/cache-nix-action@b426b118b6dc86d6952988d396aa7c6b09776d08 # v7
1318
with:
14-
primary-key: nix-${{ runner.os }}
19+
primary-key: nix-${{ runner.os }}-${{ inputs.python-version }}
20+
restore-prefixes-first-match: |
21+
nix-${{ runner.os }}-
1522
gc-max-store-size: 4G

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ jobs:
4646

4747
- name: Setup Nix
4848
uses: ./.github/actions/setup-nix
49+
with:
50+
python-version: ${{ matrix.python-version }}
4951

5052
- name: Run Lint
5153
run: nix develop .#${{ matrix.python-version }} --command just lint

0 commit comments

Comments
 (0)