Skip to content

Commit c9f319c

Browse files
Update test-cache-restore.yml
1 parent 3b438fe commit c9f319c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
uses: actions/setup-node@v6
2222
with:
2323
node-version: ${{ matrix.node-version }}
24-
2524

2625
# Determine cache path per package manager
2726
- name: Set cache path
@@ -33,13 +32,15 @@ jobs:
3332
echo "CACHE_PATH=$(pnpm store path)" >> $GITHUB_ENV
3433
elif [ "${{ matrix.package-manager }}" = "yarn" ]; then
3534
echo "CACHE_PATH=$(yarn cache dir)" >> $GITHUB_ENV
36-
fi
3735
36+
# Restore cache manually
3837
- name: Restore Node cache
39-
uses: actions/cache/restore@v5
38+
uses: actions/cache@v5
4039
with:
41-
path: ${{ env.NODE_CACHE }}
42-
key: node-cache-${{ runner.os }}-${{ env.ARCH }}-${{ matrix.package-manager }}-${{ hashFiles('**/package-lock.json', '**/npm-shrinkwrap.json', '**/pnpm-lock.yaml', '**/yarn.lock') }}
40+
path: ${{ env.CACHE_PATH }} # <- use CACHE_PATH
41+
key: node-cache-${{ runner.os }}-${{ matrix.package-manager }}-${{ hashFiles('**/package-lock.json', '**/npm-shrinkwrap.json', '**/pnpm-lock.yaml', '**/yarn.lock') }}
42+
restore-keys: |
43+
node-cache-${{ runner.os }}-${{ matrix.package-manager }}-
4344
4445
# Install dependencies
4546
- name: Install Dependencies
@@ -50,7 +51,6 @@ jobs:
5051
pnpm install
5152
elif [ "${{ matrix.package-manager }}" = "yarn" ]; then
5253
yarn install --frozen-lockfile
53-
fi
5454
5555
# Run tests
5656
- name: Run Tests
@@ -61,4 +61,3 @@ jobs:
6161
pnpm test
6262
elif [ "${{ matrix.package-manager }}" = "yarn" ]; then
6363
yarn test
64-
fi

0 commit comments

Comments
 (0)