-
Notifications
You must be signed in to change notification settings - Fork 13
83 lines (66 loc) · 2.31 KB
/
Copy pathplaywright-e2e.yml
File metadata and controls
83 lines (66 loc) · 2.31 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
name: Playwright E2E Tests
on:
pull_request:
branches: [main, dev]
push:
branches: [dev]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
NODE_VERSION: 22
jobs:
e2e:
runs-on: [self-hosted, Linux, X64]
timeout-minutes: 45
steps:
# Clean workspace to prevent permission issues on self-hosted runners
- name: Clean workspace
run: |
rm -rf "$GITHUB_WORKSPACE"/* "$GITHUB_WORKSPACE"/.[!.]* 2>/dev/null || true
rm -f .git/index.lock 2>/dev/null || true
# Clean pnpm setup directory (self-hosted runner cruft)
rm -rf ~/setup-pnpm 2>/dev/null || true
# Kill any leftover processes on test port (8887 backend serves frontend in CI)
fuser -k 8887/tcp 2>/dev/null || true
- uses: actions/checkout@v4
# Note: No cargo cache needed - self-hosted runner persists ~/.cargo and target/
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2025-12-04
- name: Install dependencies
run: pnpm install
- name: Install Playwright browsers
# Note: --with-deps removed for self-hosted runner (system deps pre-installed)
run: npx playwright install chromium
- name: Build frontend
run: cd frontend && pnpm build
- name: Build backend
run: cargo build --release --bin forge-app
env:
SQLX_OFFLINE: 'true'
- name: Setup test database directory
run: mkdir -p dev_assets
- name: Run Playwright tests
env:
SKIP_FRONTEND_BUILD: 'true' # Frontend already built above
USE_RELEASE_BINARY: 'true' # Use pre-built release binary
run: npx playwright test
- name: Upload HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 7
- name: Upload test results (videos, screenshots, traces)
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: test-results/
retention-days: 7