-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (82 loc) · 2.28 KB
/
Copy pathci.yml
File metadata and controls
99 lines (82 loc) · 2.28 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
name: CI
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
# Cancel superseded runs on the same ref (no stale-run pileup).
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
name: Backend (pytest + ruff)
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.11"
enable-cache: true
- name: Sync deps
run: uv sync
- name: Tests
run: uv run pytest -q
- name: Lint (ruff)
run: uvx ruff check app
# Informational — surfaces high-complexity functions without blocking.
- name: Complexity (radon, C+ only)
continue-on-error: true
run: uvx radon cc -s -n C app
frontend:
name: Frontend (vitest + lint + build)
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install
run: npm ci
- name: Lint (eslint)
run: npm run lint
- name: Tests
run: npm run test:run
- name: Build
run: npm run build
# Block only on production-dependency highs (dev-tool CVEs don't ship —
# prod serves the static build).
- name: Audit (prod deps, high+)
run: npm audit --omit=dev --audit-level=high
# Lighthouse needs a headless browser + preview server and is flaky to gate
# per-PR. Run on demand instead.
lighthouse:
name: Lighthouse (manual)
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: frontend/package-lock.json
- run: npm ci
- run: npm run build
- name: Lighthouse CI
continue-on-error: true
run: npx lhci autorun --config=lighthouserc.js