Repository navigation
132 lines (113 loc) · 5.05 KB
/
Copy pathe2e.yml
File metadata and controls
132 lines (113 loc) · 5.05 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: E2E Integration Tests
on:
# Run daily at 06:00 UTC to catch regressions from upstream dependency updates.
schedule:
- cron: '0 6 * * *'
# Allow maintainers to trigger a run manually from the Actions tab.
workflow_dispatch:
inputs:
use_mocks:
description: 'Use MSW mocks instead of a real bridgelet-sdk (true/false)'
required: false
default: 'true'
type: string
# Also run on pull requests that touch files consumed by the e2e tests
# so regressions are caught before merge, not just nightly.
pull_request:
branches:
- main
paths:
- 'e2e/**'
- 'frontend/app/**'
- 'frontend/components/**'
- 'frontend/lib/**'
- 'frontend/mocks/**'
- 'frontend/next.config.js'
jobs:
e2e:
name: E2E (${{ matrix.project }})
runs-on: ubuntu-latest
timeout-minutes: 30
# fail-fast: false is the point of this matrix — if WebKit breaks we
# still want Chromium/Firefox/mobile results in the same run, each
# clearly attributed to its own job rather than one aggregate pass/fail.
strategy:
fail-fast: false
matrix:
include:
# `project` maps 1:1 to a project name in e2e/playwright.config.ts
# and is passed to `--project=<name>`.
# `browser` is the underlying engine Playwright needs installed —
# the two mobile projects emulate a device on top of an existing
# desktop engine, so they reuse that engine's binary rather than
# needing a separate download.
- project: chromium
browser: chromium
- project: firefox
browser: firefox
- project: webkit
browser: webkit
- project: mobile-chrome
browser: chromium
- project: mobile-safari
browser: webkit
defaults:
run:
working-directory: e2e
steps:
- name: Checkout repository
uses: actions/checkout@v4
# ── Node setup ──────────────────────────────────────────────────────────
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
# Cache both the frontend and e2e package-lock files so neither
# restore point is invalidated by a change in the other.
cache-dependency-path: |
frontend/package-lock.json
e2e/package-lock.json
# ── Frontend dependencies ────────────────────────────────────────────────
- name: Install frontend dependencies
run: npm ci
working-directory: frontend
# ── E2E dependencies ─────────────────────────────────────────────────────
- name: Install e2e dependencies
run: npm ci
working-directory: e2e
- name: Install Playwright browser (${{ matrix.browser }})
run: npx playwright install --with-deps ${{ matrix.browser }}
working-directory: e2e
# ── Run tests ────────────────────────────────────────────────────────────
- name: Run E2E tests — ${{ matrix.project }}
run: npx playwright test --project=${{ matrix.project }} --reporter=github
working-directory: e2e
env:
CI: true
# Default to MSW mocked mode; override via workflow_dispatch input
# or repository/environment secret for real-backend runs.
E2E_USE_MOCKS: ${{ github.event.inputs.use_mocks || 'true' }}
# The playwright config starts the dev server at localhost:3000.
# Override this in real-backend runs via repository secrets.
E2E_BASE_URL: ${{ vars.E2E_BASE_URL || 'http://localhost:3000' }}
E2E_API_BASE_URL: ${{ vars.E2E_API_BASE_URL || '' }}
# ── Artifacts ────────────────────────────────────────────────────────────
# Artifact names include the project so a reviewer can jump straight
# to (e.g.) the mobile-safari report without guessing which run it was.
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.project }}-${{ github.run_id }}
path: |
frontend/test-results/
e2e/playwright-report/
retention-days: 14
- name: Upload trace files on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-traces-${{ matrix.project }}-${{ github.run_id }}
path: frontend/test-results/**/*.zip
retention-days: 7