-
Notifications
You must be signed in to change notification settings - Fork 1
120 lines (94 loc) · 3.6 KB
/
Copy pathci.yml
File metadata and controls
120 lines (94 loc) · 3.6 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test Node ${{ matrix.node-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
# Windows runners bill at 2x Actions minutes. Run the full cross-OS matrix on push to
# main (the source of truth), but keep pull requests Ubuntu-only — the vast majority of
# runs — so the 2,000-minute monthly quota lasts. Node 20 + 22 stay on every run.
matrix:
os: ${{ github.event_name == 'push' && fromJSON('["ubuntu-latest", "windows-latest"]') || fromJSON('["ubuntu-latest"]') }}
node-version: [ 20, 22 ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: npm ci
- name: Install Python test dependencies (FastAPI runtime test)
run: python -m pip install --quiet fastapi uvicorn
- name: Run tests
run: npm test
# the router selftest exercises the GENERATED artifact (templates +
# ADR-022 runtime key resolution) — vitest never loads it, so CI must
- name: Router selftest (generated artifact)
run: node tests/router-selftest.cjs
lint:
name: Lint & format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: ESLint
run: npm run lint
- name: Prettier (check)
run: npm run format:check
# Fails if a README route count drifts from bench/route-proof.json (the committed,
# reproducible evidence). Keeps the headline honest — no clone, no network.
- name: README claims match the bench evidence
run: if [ -f bench/check-readme.mjs ]; then npm run bench:check; else echo "Skipped on public mirror"; fi
# Mutation testing (home-grown, zero-dep): introduces a mutation into each soundness-/
# correctness-critical line and requires a test to KILL it. A surviving mutant = a guarded
# line with no test that bites. The reproduction of DNA-polymerase coupled proofreading.
- name: Mutation testing (guardian tests must bite)
run: npm run mutation
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: npm ci
- name: Install Python test dependencies (FastAPI runtime test)
run: python -m pip install --quiet fastapi uvicorn
- name: Run coverage
run: npm run coverage
# Tokenless upload works on the public mirror only; gated so the private
# HQ run stays quiet. Never fails CI — coverage is report-only (no gate yet).
- name: Upload coverage to Codecov
if: github.repository == 'zyx77550/sparda'
uses: codecov/codecov-action@v5
with:
files: ./coverage/lcov.info
fail_ci_if_error: false