Skip to content

Commit 258c46b

Browse files
committed
ci: fix Windows cache restore to only use dist artifacts
Split cache restore into OS-specific steps: - Linux: Restore both dist and node_modules from cache - Windows: Only restore dist (node_modules are platform-specific) Windows then runs pnpm install to create its own node_modules. This prevents cache miss failures on Windows test jobs.
1 parent c5f4a47 commit 258c46b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ jobs:
104104
node-version: ${{ matrix.node }}
105105
cache: 'pnpm'
106106

107-
- name: Restore build artifacts
107+
- name: Restore build artifacts (Linux)
108+
if: runner.os == 'Linux'
108109
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
109110
with:
110111
path: |
@@ -113,6 +114,14 @@ jobs:
113114
key: build-${{ github.sha }}-Linux
114115
fail-on-cache-miss: true
115116

117+
- name: Restore build artifacts (Windows)
118+
if: runner.os == 'Windows'
119+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
120+
with:
121+
path: dist
122+
key: build-${{ github.sha }}-Linux
123+
fail-on-cache-miss: true
124+
116125
- name: Install dependencies (Windows)
117126
if: runner.os == 'Windows'
118127
run: pnpm install --frozen-lockfile

0 commit comments

Comments
 (0)