-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (75 loc) · 2.23 KB
/
frontend-e2e.yml
File metadata and controls
87 lines (75 loc) · 2.23 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
name: Reusable Frontend E2E Tests
on:
workflow_call:
inputs:
python-version:
description: Python version for the backend.
required: false
type: string
default: "3.12"
node-version:
description: Node.js version.
required: false
type: string
default: "22"
install-spec:
description: Pip install spec for the backend.
required: false
type: string
default: ".[dev]"
working-directory:
description: Path to the frontend directory.
required: false
type: string
default: "frontend"
jobs:
e2e:
name: Playwright
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.python-version }}
cache: "pip"
- name: Install backend dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e "${{ inputs.install-spec }}"
working-directory: .
- name: Start backend
run: |
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 &
# Wait for backend to be ready
for i in $(seq 1 30); do
curl -sf http://localhost:8000/health && break
sleep 1
done
working-directory: .
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: "npm"
cache-dependency-path: ${{ inputs.working-directory }}/package-lock.json
- name: Install frontend dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run E2E tests
run: npm test
env:
CI: "true"
VITE_AUTH_DISABLED: "true"
- name: Upload test results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: ${{ inputs.working-directory }}/test-results/
retention-days: 7