Skip to content

Commit c337540

Browse files
Update Node.js setup and cache restoration steps
1 parent 2864b77 commit c337540

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/test-cache-restore.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,31 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v6
1515

16+
# Setup Node.js only (no cache here – handled manually)
1617
- name: Setup Node.js
1718
id: setup-node
1819
uses: actions/setup-node@v6
1920
with:
2021
node-version: '21'
21-
22+
23+
# Ensure pnpm is available if pnpm-lock.yaml exists
24+
- name: Setup pnpm
25+
if: hashFiles('**/pnpm-lock.yaml') != ''
26+
uses: pnpm/action-setup@v4
27+
with:
28+
version: 10
2229

2330
# Normalize runner.arch (x64 / arm64)
2431
- name: Normalize runner architecture
2532
shell: bash
2633
run: |
2734
echo "ARCH=$(echo '${{ runner.arch }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
2835
29-
# Detect package manager + cache path (Node equivalent of `go env`)
36+
# Detect package manager + cache path
3037
- name: Detect package manager and cache path
3138
shell: bash
3239
run: |
3340
set -e
34-
3541
if [ -f pnpm-lock.yaml ]; then
3642
PM=pnpm
3743
CACHE_PATH=$(pnpm store path)
@@ -45,7 +51,6 @@ jobs:
4551
CACHE_PATH=$(npm config get cache)
4652
LOCK_PATTERN="**/package-lock.json"
4753
fi
48-
4954
echo "PACKAGE_MANAGER=$PM" >> $GITHUB_ENV
5055
echo "NODE_CACHE=$CACHE_PATH" >> $GITHUB_ENV
5156
echo "LOCK_PATTERN=$LOCK_PATTERN" >> $GITHUB_ENV
@@ -58,7 +63,7 @@ jobs:
5863
echo "NODE_CACHE=$NODE_CACHE"
5964
echo "LOCK_PATTERN=$LOCK_PATTERN"
6065
61-
# Restore Node cache (setup-go equivalent)
66+
# Restore Node cache
6267
- name: Restore Node cache
6368
id: node-cache
6469
uses: actions/cache/restore@v5

0 commit comments

Comments
 (0)