Skip to content

Commit 4d80072

Browse files
committed
perf(ci): add pnpm store cache for faster dependency install
Cache pnpm store directory to avoid re-downloading packages. The cache key is based on OS and pnpm-lock.yaml hash.
1 parent fec2c81 commit 4d80072

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ runs:
3434
done
3535
nix profile install --inputs-from . $packages
3636
37+
- name: Get pnpm store directory
38+
if: inputs.skip-pnpm-install != 'true'
39+
id: pnpm-cache
40+
shell: bash
41+
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
42+
43+
- name: Restore pnpm cache
44+
if: inputs.skip-pnpm-install != 'true'
45+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
46+
with:
47+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
48+
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
49+
restore-keys: |
50+
pnpm-${{ runner.os }}-
51+
3752
- name: Install pnpm dependencies
3853
if: inputs.skip-pnpm-install != 'true'
3954
shell: bash

0 commit comments

Comments
 (0)