Skip to content

Commit

Permalink
ci: fix cache keys (#29962)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Jul 1, 2024
1 parent 6d01a1d commit 174b1bf
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ runs:
(steps.node-modules-restore.outputs.cache-hit == 'true') && 'true' || ''
}}' >> "$GITHUB_ENV"
- name: Calculate `PNPM_STORE`
shell: bash
run: |
echo "PNPM_STORE=$(pnpm store path)" >> "$GITHUB_ENV"
- name: Setup pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
with:
Expand All @@ -56,7 +61,21 @@ runs:
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ inputs.node-version }}
cache: ${{ env.CACHE_HIT != 'true' && 'pnpm' || '' }}

- name: Cache and restore `pnpm store`
if: env.CACHE_HIT != 'true'
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ env.PNPM_STORE }}
key: |
pnpm_store-${{
inputs.os
}}-${{
inputs.node-version
}}-${{
hashFiles('pnpm-lock.yaml', 'package.json')
}}
enableCrossOsArchive: true

- name: Install dependencies
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
Expand Down

0 comments on commit 174b1bf

Please sign in to comment.