-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (130 loc) · 4.9 KB
/
Copy pathci.yml
File metadata and controls
154 lines (130 loc) · 4.9 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
# Concurrency: cancel previous in-flight runs on the same branch when a new
# push lands. Saves CI minutes on rapid pushes.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# ---------------------------------------------------------------------------
# test-engine — fast inner loop: pure Python engine, matrix on 3.11/3.12/3.13.
# This is what gates PR merges. Studio (FastAPI + SQLModel) lives in its own
# job so an engine break is detected at the same time as it happens.
# ---------------------------------------------------------------------------
test-engine:
name: Engine tests (py ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install (engine + dev deps)
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Lint (ruff)
run: ruff check src/ tests/
- name: Format check (black)
run: black --check src/ tests/
- name: Engine test suite (excludes studio)
# --cov-fail-under=85 enforces the roadmap "Indicateurs de santé"
# target for src/hmm_core/. The Valentin ETH regression and Bayesian
# NUTS tests are skipped automatically (missing optional deps /
# dataset path) — they're not part of the engine coverage gate.
run: |
pytest tests/ \
--ignore=tests/studio \
--cov=src/hmm_core \
--cov-report=term \
--cov-report=xml \
--cov-fail-under=85
- name: Upload coverage
if: matrix.python-version == '3.12'
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml
retention-days: 7
# ---------------------------------------------------------------------------
# test-studio — FastAPI + SQLModel + warehouse endpoint suite.
# Needs the [web] extra. Runs only on 3.12 (the supported studio runtime)
# to keep CI minutes bounded.
# ---------------------------------------------------------------------------
test-studio:
name: Studio tests (FastAPI + SQLModel)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install (engine + web + dev)
run: |
python -m pip install --upgrade pip
pip install -e ".[web,dev]"
- name: Studio test suite
run: pytest tests/studio/ -v
# ---------------------------------------------------------------------------
# readme-snippets — executes the canonical Python snippets from README.md
# to prevent API drift (e.g. the legacy `state_labels=` -> `states=` typo
# that survived in the README before A.7 user-facing close).
# ---------------------------------------------------------------------------
readme-snippets:
name: README snippets smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install (engine + dev)
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Run README snippet smoke tests
run: pytest tests/test_readme_snippets.py -v
# ---------------------------------------------------------------------------
# frontend — typecheck + build the React studio. Catches breakage on main
# without waiting for the (slower) E2E job. No deploy here — release.yml
# owns the publish path.
# ---------------------------------------------------------------------------
frontend:
name: Frontend lint + build
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/hmm_studio/frontend
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: src/hmm_studio/frontend/package-lock.json
- name: Install (npm ci)
run: npm ci
- name: TypeScript check (npm run lint = tsc --noEmit)
run: npm run lint
- name: Unit tests (vitest)
run: npm test
- name: Build (tsc + vite)
run: npm run build