Skip to content

Commit ee9d5f0

Browse files
committed
fix: use artifacts instead of cache for playwright build sharing
GitHub Actions cache doesn't work across host/container boundaries. The playwright-build job runs on ubuntu-latest host while playwright test jobs run inside mcr.microsoft.com/playwright container. Switch to artifacts which properly transfer between host and container.
1 parent 582f016 commit ee9d5f0

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,14 @@ jobs:
103103
- name: Build packages
104104
run: pnpm run build
105105

106-
- name: Cache build artifacts
107-
uses: actions/cache/save@v4
106+
- name: Upload build artifacts
107+
uses: actions/upload-artifact@v4
108108
with:
109+
name: playwright-build
109110
path: |
110111
packages/*/dist
111112
playground/dist
112-
node_modules
113-
packages/*/node_modules
114-
key: playwright-build-${{ github.event.pull_request.head.sha || github.sha }}
113+
retention-days: 1
115114

116115
playwright:
117116
name: "Playwright Tests - ${{ matrix.browser }} (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})"
@@ -140,16 +139,13 @@ jobs:
140139
cache-dependency-path: "**/pnpm-lock.yaml"
141140
node-version-file: ".nvmrc"
142141

143-
- name: Restore build artifacts
144-
uses: actions/cache/restore@v4
142+
- name: Download build artifacts
143+
uses: actions/download-artifact@v4
145144
with:
146-
path: |
147-
packages/*/dist
148-
playground/dist
149-
node_modules
150-
packages/*/node_modules
151-
key: playwright-build-${{ github.event.pull_request.head.sha || github.sha }}
152-
fail-on-cache-miss: true
145+
name: playwright-build
146+
147+
- name: Install dependencies
148+
run: pnpm install
153149

154150
- name: Run server and Playwright tests
155151
run: |

0 commit comments

Comments
 (0)