-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (81 loc) · 2.59 KB
/
Copy pathci.yml
File metadata and controls
87 lines (81 loc) · 2.59 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: CI
# Runs on every PR and on pushes to the integration branches.
# Backend unit+integration tests and the frontend production build always run.
# Playwright e2e runs against a live single-origin server (built frontend served
# by FastAPI) — the exact shape the app ships in.
on:
pull_request:
push:
branches: [feature/rebuild-v0.2, main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- run: uv sync --frozen
- name: Migrations apply cleanly
run: uv run alembic upgrade head
- name: Unit + integration tests
run: uv run pytest tests/unit tests/integration -q
frontend-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 11
- uses: actions/setup-node@v4
with:
node-version-file: frontend/.nvmrc
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
working-directory: frontend
- run: pnpm build
working-directory: frontend
e2e:
runs-on: ubuntu-latest
needs: [backend, frontend-build]
env:
HELMSMAN_ADMIN_KEY: ci-admin-key-0123456789
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- run: uv sync --frozen
- uses: pnpm/action-setup@v4
with:
version: 11
- uses: actions/setup-node@v4
with:
node-version-file: frontend/.nvmrc
cache: pnpm
cache-dependency-path: frontend/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
working-directory: frontend
- name: Build frontend (served by the API at /app)
run: pnpm build
working-directory: frontend
- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium
- name: Migrate + boot server
run: |
uv run alembic upgrade head
uv run python -m src &
for i in $(seq 1 20); do curl -fsS http://localhost:8001/api/health && break || sleep 1; done
- name: Playwright e2e
run: BASE_URL=http://localhost:8001 pnpm exec playwright test --reporter=line
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report