Skip to content

Commit 935ca7a

Browse files
authored
Merge branch 'main' into ci/e2e-drop-unused-webkit
2 parents 00fa428 + c379fb9 commit 935ca7a

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,24 @@ jobs:
3434
- name: Install dependencies
3535
run: pnpm install --frozen-lockfile
3636

37+
- name: Resolve Playwright version
38+
id: playwright-version
39+
run: echo "version=$(pnpm exec playwright --version | awk '{print $2}')" >> "$GITHUB_OUTPUT"
40+
3741
- name: Cache Playwright browsers
3842
uses: actions/cache@v4
39-
id: playwright-cache
4043
with:
4144
path: ~/.cache/ms-playwright
42-
key: playwright-chromium-${{ runner.os }}-${{ hashFiles('widget/pnpm-lock.yaml') }}
43-
44-
- name: Install Playwright browsers
45-
if: steps.playwright-cache.outputs.cache-hit != 'true'
46-
run: pnpm exec playwright install --with-deps chromium
45+
# Key on the resolved Playwright version: each version pins specific
46+
# browser builds (e.g. webkit-2272), so a bump auto-invalidates the cache.
47+
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
4748

48-
- name: Install Playwright system deps
49-
if: steps.playwright-cache.outputs.cache-hit == 'true'
50-
run: pnpm exec playwright install-deps chromium
49+
# Run unconditionally. `playwright install` is idempotent: it only downloads
50+
# browsers missing from the (possibly cached) ms-playwright dir, so a partial
51+
# or stale cache self-heals here instead of permanently skipping the binary
52+
# install. --with-deps re-applies system libraries, which are not cached.
53+
- name: Install Playwright browsers and system dependencies
54+
run: pnpm exec playwright install --with-deps chromium webkit
5155

5256
- name: Run E2E tests
5357
run: pnpm e2e

widget/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"test:coverage": "vitest run --coverage",
6464
"e2e": "playwright test",
6565
"e2e:ui": "playwright test --ui",
66-
"e2e:install": "playwright install chromium",
66+
"e2e:install": "playwright install chromium webkit",
6767
"lint": "eslint src/",
6868
"lint:fix": "eslint src/ --fix",
6969
"format": "prettier --write \"src/**/*.{ts,tsx,css}\"",

widget/playwright.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export default defineConfig({
2828
testIgnore: ["**/mobile.spec.ts"],
2929
},
3030
{
31-
name: "chromium-mobile",
31+
// iPhone 13 emulation runs on WebKit (Mobile Safari), not Chromium —
32+
// name it accordingly so CI installs the right browser binary.
33+
name: "mobile-safari",
3234
use: { ...devices["iPhone 13"] },
3335
testMatch: ["**/mobile.spec.ts"],
3436
},

0 commit comments

Comments
 (0)