Skip to content

fix(cli): idtracker.ai options in add, add --allow-pickle, validate probes sessions #353

fix(cli): idtracker.ai options in add, add --allow-pickle, validate probes sessions

fix(cli): idtracker.ai options in add, add --allow-pickle, validate probes sessions #353

Workflow file for this run

name: CI
on:
push:
branches: [main]
# Docs-only pushes to main skip CI. Deliberately NOT mirrored onto
# pull_request below: `CI passed` is a required status check on main,
# and a required check that never reports leaves the PR permanently
# unmergeable. Running CI on a docs-only PR costs nothing now that the
# repository is public and Actions minutes are unmetered.
paths-ignore:
- "docs/**"
- "**.md"
- "LICENSE"
pull_request:
# Superseded runs on the same PR branch are cancelled -- a 3-push burst
# used to run three full matrices to answer a question only the last one
# was asking. Pushes to main are never cancelled: every commit on main
# should have its own recorded CI result.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint:
name: Lint (ruff)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.11"
- run: pip install ruff
- run: ruff check .
typecheck:
name: Types (mypy)
# Required from the start rather than advisory: the engine is clean
# today, and a non-required job that is already green protects nothing.
# Ruff's ANN rules require annotations everywhere; this is what checks
# they are correct. Engine only -- see [tool.mypy] in pyproject.toml.
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.11"
- name: Install package + dev deps
run: pip install -e ".[dev]"
- run: mypy
workflows:
name: Lint workflows (actionlint)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.11"
# actionlint runs shellcheck over every run: block when it is on PATH.
- run: pip install actionlint-py shellcheck-py
- run: actionlint
test:
name: Tests (${{ matrix.os }} / Python ${{ matrix.python }})
strategy:
fail-fast: false
matrix:
# PRs run Linux only; the full three-OS matrix runs on pushes to
# main and in release.yml (which builds all three on `v*` tags and
# via workflow_dispatch). GitHub bills each job rounded up to a
# whole minute times a per-OS multiplier -- Linux 1x, Windows 2x,
# macOS 10x -- so the two ~1-minute macOS jobs were ~30 of the ~45
# billed minutes per run, two thirds of the bill for under two
# minutes of real work.
os: ${{ github.event_name == 'pull_request' && fromJSON('["ubuntu-22.04"]') || fromJSON('["ubuntu-22.04", "windows-2022", "macos-26"]') }}
python: ["3.11", "3.12"]
# Both interpreters are covered on Linux; the expensive runners
# only need to prove the platform works, not the version spread.
# These excludes are inert on PRs, where neither OS is in the list.
exclude:
- os: windows-2022
python: "3.12"
- os: macos-26
python: "3.12"
runs-on: ${{ matrix.os }}
env:
# PySide6 has no display to attach to on CI runners; the offscreen
# platform plugin lets QApplication() succeed headlessly.
QT_QPA_PLATFORM: offscreen
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Install Qt runtime libraries (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libegl1 libxkbcommon-x11-0 libgl1
- name: Install package + dev deps
run: pip install -e ".[dev]"
- name: Run unit tests (excluding r_parity and network)
# Coverage covers the whole shipped package (track2data + app + ui);
# the per-package floors are enforced in the next step. See
# docs/TECHNICAL_SPEC.md §11.
#
# `network` covers tests/test_references_resolve.py, which asks
# Crossref to confirm every DOI in the bibliography resolves to
# the work claimed. Thirty-five HTTP requests per matrix cell on
# every push would be slow and impolite to a free public API, and
# a Crossref outage would redden CI without anything here being
# broken. Run it deliberately when adding or editing a reference:
# pytest tests/test_references_resolve.py -m network
run: >
pytest tests/ -v -m "not r_parity and not network"
--cov --cov-report=term
- name: Enforce per-package coverage floors
# Two thresholds from the one coverage run above. Separate because a
# well-covered GUI must not be able to mask an engine regression --
# a bug in the engine changes exported numbers, a bug in the GUI is
# visible to the person hitting it. Engine ~96%, GUI ~90% today, so
# both floors have real headroom without being decorative.
run: |
coverage report --include='track2data/*' --fail-under=90
coverage report --include='app/*,ui/*' --fail-under=85
r_parity:
name: R-parity (synthetic fixtures)
runs-on: ubuntu-22.04
env:
# pytest-qt is pulled in transitively by the [dev] extra and imports
# QtGui at collection time regardless of which tests actually run, so
# this job needs the same headless Qt setup as `test` even though it
# never touches the GUI itself.
QT_QPA_PLATFORM: offscreen
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.11"
- name: Install Qt runtime libraries
run: |
sudo apt-get update
sudo apt-get install -y libegl1 libxkbcommon-x11-0 libgl1
- name: Install package + dev deps
run: pip install -e ".[dev]"
- name: Run r_parity tests against synthetic tiny_v5 fixture
# r_parity_local tests use embargoed choice-pipeline data and are
# excluded here. Run them locally with: pytest -m r_parity_local
run: pytest tests/test_r_parity/ -v -m "r_parity and not r_parity_local"
required:
name: CI passed
# Single aggregate gate, and the only check required by branch
# protection on main. The matrix job names encode the OS and Python
# spread ("Tests (ubuntu-22.04 / Python 3.11)"), so requiring them
# directly would mean editing the branch-protection settings by hand
# every time the matrix changes -- and a required check whose name no
# longer exists blocks every PR until someone notices. One stable name
# keeps settings and workflow decoupled.
if: always()
needs: [lint, typecheck, workflows, test, r_parity]
runs-on: ubuntu-22.04
steps:
- name: Fail unless every upstream job succeeded
# `needs` results are only 'success' when the whole job (every
# matrix leg included) passed, so this catches a single failing
# matrix entry as well as a wholesale job failure.
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "lint=${{ needs.lint.result }}"
echo "typecheck=${{ needs.typecheck.result }}"
echo "workflows=${{ needs.workflows.result }}"
echo "test=${{ needs.test.result }}"
echo "r_parity=${{ needs.r_parity.result }}"
echo "::error::One or more CI jobs did not succeed."
exit 1