Skip to content

supervised fit

supervised fit #43

Workflow file for this run

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: Build (tsc + vite)
run: npm run build