-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (107 loc) · 3.4 KB
/
Copy pathtest.yml
File metadata and controls
138 lines (107 loc) · 3.4 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
name: CI
on:
push:
pull_request:
jobs:
backend-quality:
name: Backend lint/typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install dependencies
run: make python-sync
- name: Check Python lockfile
run: make python-lock-check
- name: Run backend lint
run: make lint
- name: Run release hygiene guard
run: make hygiene
- name: Run backend typecheck
run: make typecheck
backend-tests:
name: Backend tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install dependencies
run: make python-sync
- name: Bootstrap database schema
run: PYTHONPATH=. .venv/bin/python backend/data/database.py
- name: Run backend tests with coverage
run: make coverage
- name: Publish coverage summary
if: always()
run: |
if [ -f coverage.xml ]; then
pct=$(python3 -c "import xml.etree.ElementTree as ET; print(round(float(ET.parse('coverage.xml').getroot().get('line-rate')) * 100, 1))")
echo "### Backend coverage" >> $GITHUB_STEP_SUMMARY
echo "Line coverage: **${pct}%** (gate: fail_under in pyproject.toml)" >> $GITHUB_STEP_SUMMARY
fi
- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: backend-coverage
path: coverage.xml
security:
name: Security and dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install dependencies
run: make python-sync
- name: Run low-noise security snapshot
run: make security
- name: Run dependency audit
run: |
make dependency-audit
echo "### Dependency audit" >> $GITHUB_STEP_SUMMARY
echo "Audit completed at $(date -u '+%Y-%m-%dT%H:%M:%SZ'). No known vulnerabilities found." >> $GITHUB_STEP_SUMMARY
frontend:
name: Frontend test/build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
working-directory: frontend
run: npm ci
- name: Install browser runtime
working-directory: frontend
run: npx playwright install --with-deps chromium
- name: Run frontend tests
run: make frontend-test
- name: Run frontend ESLint gate
run: make frontend-lint
- name: Run frontend build
run: make build
- name: Run demo and live-mode browser smoke
run: make frontend-smoke