-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (85 loc) · 2.78 KB
/
Copy pathweb-e2e.yml
File metadata and controls
100 lines (85 loc) · 2.78 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
name: Web E2E
# Manual-only for now. The backend's lifespan requires a reachable LLM
# provider (Ollama by default per config/config.yaml), which CI runners
# don't have. v2.1 will introduce an opt-in stub-provider config so this
# can run on every PR; until then, run Playwright locally against the
# Caddy-fronted backend (see docs/REACT_UI_PARITY.md "Verification"
# section).
on:
workflow_dispatch:
jobs:
playwright:
name: Build SPA + boot backend + Playwright
runs-on: ubuntu-latest
timeout-minutes: 25
env:
OLLAMA_API_KEY: ""
OPENROUTER_API_KEY: ""
AZURE_OPENAI_KEY: ""
AZURE_DEPLOYMENT: ""
AZURE_ENDPOINT: https://ci-dummy.example/
EXTERNAL_MCP_URL: https://ci-dummy.example/
EXT_TOKEN: ci-dummy
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Set up Python 3.11
uses: actions/setup-python@v6.2.0
with:
python-version: "3.11"
- name: Set up uv
uses: astral-sh/setup-uv@v6.7.0
with:
version: "0.11.7"
enable-cache: true
- name: Install Python deps (locked)
run: uv sync --frozen --extra dev
- name: Set up Node 22
uses: actions/setup-node@v6.0.0
with:
node-version: "22"
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install web deps (locked)
working-directory: web
run: npm ci
- name: Build SPA
working-directory: web
run: npm run build
- name: Install Playwright browsers
working-directory: web
run: npx playwright install --with-deps chromium
- name: Boot backend (serves SPA + API)
run: |
mkdir -p logs
nohup uv run uvicorn runtime.api:get_app --factory --port 8000 > logs/uvicorn.log 2>&1 &
echo $! > .backend.pid
for i in $(seq 1 60); do
if curl -sf http://localhost:8000/health >/dev/null; then
echo "backend ready after ${i}s"
exit 0
fi
sleep 1
done
echo "backend failed to start"
tail -200 logs/uvicorn.log
exit 1
- name: Run Playwright
working-directory: web
env:
E2E_BASE_URL: http://localhost:8000
run: npx playwright test --reporter=list
- name: Stop backend
if: always()
run: |
if [ -f .backend.pid ]; then kill "$(cat .backend.pid)" 2>/dev/null || true; fi
- name: Upload Playwright report (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
web/playwright-report
web/test-results
logs/uvicorn.log
retention-days: 7