-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.92 KB
/
Copy pathe2e.yml
File metadata and controls
65 lines (54 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: E2E
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
playwright:
name: Playwright E2E
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: widget
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: widget/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Resolve Playwright version
id: playwright-version
run: echo "version=$(pnpm exec playwright --version | awk '{print $2}')" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
# Key on the resolved Playwright version: each version pins specific
# browser builds (e.g. webkit-2272), so a bump auto-invalidates the cache.
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
# Run unconditionally. `playwright install` is idempotent: it only downloads
# browsers missing from the (possibly cached) ms-playwright dir, so a partial
# or stale cache self-heals here instead of permanently skipping the binary
# install. --with-deps re-applies system libraries, which are not cached.
- name: Install Playwright browsers and system dependencies
run: pnpm exec playwright install --with-deps chromium webkit
- name: Run E2E tests
run: pnpm e2e
- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: widget/playwright-report
retention-days: 7