Make CI parity failures concise and actionable #399
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Native backend CI | |
| on: | |
| pull_request: | |
| push: | |
| jobs: | |
| native-backend: | |
| name: Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install build tools | |
| run: | | |
| python -m pip install -q -U pip | |
| # numpy pinned <2.5: the R parity cache keys hash test inputs generated via | |
| # multivariate_normal (LAPACK SVD). numpy 2.5.x bundles an OpenBLAS whose SVD | |
| # kernels differ on some runner CPUs, changing inputs bit-for-bit and causing | |
| # cache misses. Re-evaluate at the next full live-R cache regeneration. | |
| python -m pip install -q build scikit-build-core nanobind pytest ruff mypy "numpy<2.5" scipy | |
| python -m pip install -q hypothesis pytest-benchmark pytest-xdist | |
| - name: Install package editable | |
| run: python -m pip install -q -e . | |
| - name: Run native import smoke test | |
| run: python -c "import nns._nnscore as c; print(c.lpm(2.0, 0.0, [-2.0, -1.0, 0.5, 3.0]))" | |
| - name: Run invariants without Rscript | |
| run: | | |
| set +e | |
| python -m pytest -q --tb=short tests/invariants > invariant-results.txt 2>&1 | |
| status=$? | |
| cat invariant-results.txt | |
| exit $status | |
| - name: Run parity from committed R cache | |
| run: NNS_R_CACHE_ONLY=1 python -m pytest -q --tb=short tests/parity | |
| - name: Run plotting color-fidelity tests | |
| run: python -m pytest -q --tb=short tests/plotting | |
| - name: Run vignette examples | |
| run: | | |
| if [ -f tests/docs/test_vignette_examples.py ]; then | |
| python -m pytest -q --tb=short tests/docs/test_vignette_examples.py | |
| else | |
| echo "No docs vignette test present; skipping." | |
| fi | |
| - name: Run ruff | |
| run: ruff check . | |
| - name: Run mypy | |
| run: mypy | |
| - name: Build distributions | |
| run: python -m build |