|
| 1 | +# Run lint, format-check, and tests on every push to main and on every PR. |
| 2 | +# |
| 3 | +# Local equivalent: `scripts/check.sh` (which expects a local .venv; |
| 4 | +# this workflow uses the runner's python directly so it doesn't depend |
| 5 | +# on that layout). |
| 6 | + |
| 7 | +name: ci |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + branches: [main] |
| 12 | + pull_request: |
| 13 | + branches: [main] |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +# Force JavaScript-based actions to use Node 24 — same reason as |
| 17 | +# docs.yml: GitHub deprecated Node 20 actions in late 2025 and removes |
| 18 | +# Node 20 from runners on 2026-09-16. |
| 19 | +env: |
| 20 | + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: read |
| 24 | + |
| 25 | +# Cancel in-flight runs on the same ref when a new commit lands; PRs |
| 26 | +# rebased many times in quick succession don't queue up wasted minutes. |
| 27 | +concurrency: |
| 28 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 29 | + cancel-in-progress: true |
| 30 | + |
| 31 | +jobs: |
| 32 | + test: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - uses: actions/setup-python@v5 |
| 38 | + with: |
| 39 | + python-version: "3.13" |
| 40 | + |
| 41 | + - name: Install package + dev extras |
| 42 | + run: | |
| 43 | + python -m pip install --upgrade pip |
| 44 | + pip install -e ".[dev]" |
| 45 | +
|
| 46 | + - name: Fetch upstream Kikawa Auspice JSONs |
| 47 | + # Real-data tests in tests/test_real_data.py and tests/test_cli.py |
| 48 | + # skip cleanly when these files are absent. We want them to |
| 49 | + # actually run in CI, so fetch the upstream JSONs first. |
| 50 | + run: python examples/fetch_auspice_data.py |
| 51 | + |
| 52 | + - name: Build Kikawa titer chart specs |
| 53 | + # tests/test_real_data.py also reads the saved Vega-Lite specs |
| 54 | + # produced by this script. Ditto for tests/test_cli.py end-to-end. |
| 55 | + run: python examples/flu-seqneut-2025to2026_titer_charts.py |
| 56 | + |
| 57 | + - name: Lint (ruff) |
| 58 | + run: ruff check . |
| 59 | + |
| 60 | + - name: Format check (black) |
| 61 | + run: black --check . |
| 62 | + |
| 63 | + - name: Tests (pytest) |
| 64 | + run: pytest tests/ |
0 commit comments