Skip to content

test(quiz): pin mid-save failures and the start form's assumptions; fix two doc claims (#79) #172

test(quiz): pin mid-save failures and the start form's assumptions; fix two doc claims (#79)

test(quiz): pin mid-save failures and the start form's assumptions; fix two doc claims (#79) #172

Workflow file for this run

name: CI
# Kept to three short jobs: every job repeats checkout, Python setup and the
# lockfile install, so splitting cheap checks into more jobs only adds overhead.
# Job names are required checks in the protect-main ruleset; rename them there
# too. No path filters: a skipped workflow leaves required checks pending, and
# the secret scans cover docs as well.
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
quality:
name: lint / types / architecture / deps
# Draft PRs wait for ready_for_review; a skipped job satisfies a required check.
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # full history for the gitleaks scan
- name: Git history secret scan
uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # pragma: allowlist secret
# Pinned so the rule-scoped allowlist in .gitleaks.toml keeps the
# semantics it was verified against.
GITLEAKS_VERSION: "8.30.1"
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.10"
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: true
cache-dependency-glob: requirements-dev.txt
- name: Install pinned dev toolchain
# uv installs the same lockfile as pip, in a few seconds instead of ~15.
run: uv pip install --system -r requirements-dev.txt
- name: Working tree secret scan (audited baseline)
# Rejects any finding in git-tracked files that is not in the audited
# baseline and never writes the baseline (scripts/check_secrets.py).
run: python scripts/check_secrets.py
- name: Lint
run: ruff check .
- name: Type check (strict)
run: mypy
- name: Architecture layers
run: lint-imports
- name: Unused / undeclared dependency scan
run: deptry .
- name: Complexity ratchet
# Gates the average (-a B) and per-module (-m C) complexity only.
# `-b F` is the loosest block rank, so it does NOT stop a new
# worst-case (rank F) block from landing; review catches those.
# ms_auth.py (SSO state machine) is excluded as a known hotspot.
run: xenon -a B -m C -b F -e "*/ms_auth.py" lighthouse_cli
tests:
name: tests (py${{ matrix.python-version }})
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
# The lockfile is compiled for 3.10 but every pin also resolves on
# 3.13; both legs install it so 3.13 never floats to new versions.
# Coverage is measured on one leg only.
- python-version: "3.10"
pytest-args: --cov --cov-report=term
- python-version: "3.13"
pytest-args: ""
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: true
cache-dependency-glob: requirements-dev.txt
- name: Install
run: uv pip install --system -r requirements-dev.txt && uv pip install --system -e . --no-deps
# The full suite includes the repository policy and secret-gate tests.
# pytest-xdist spreads it over the runner's cores.
- name: Test suite
run: pytest -q -n auto --durations=10 ${{ matrix.pytest-args }}