|
5 | 5 | push: |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - vignette-diagnostic: |
9 | | - name: Vignette diagnostic |
| 8 | + native-backend: |
| 9 | + name: Python ${{ matrix.python-version }} |
10 | 10 | runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + python-version: ["3.11", "3.12", "3.13", "3.14"] |
| 15 | + |
11 | 16 | steps: |
12 | 17 | - name: Check out repo |
13 | 18 | uses: actions/checkout@v4 |
14 | 19 |
|
15 | 20 | - name: Set up Python |
16 | 21 | uses: actions/setup-python@v5 |
17 | 22 | with: |
18 | | - python-version: "3.11" |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + |
| 25 | + - name: Install build tools |
| 26 | + run: | |
| 27 | + python -m pip install -U pip |
| 28 | + # numpy pinned <2.5: the R parity cache keys hash test inputs generated via |
| 29 | + # multivariate_normal (LAPACK SVD). numpy 2.5.x bundles an OpenBLAS whose SVD |
| 30 | + # kernels differ on some runner CPUs, changing inputs bit-for-bit and causing |
| 31 | + # cache misses. Re-evaluate at the next full live-R cache regeneration. |
| 32 | + python -m pip install build scikit-build-core nanobind pytest ruff mypy "numpy<2.5" scipy |
| 33 | + python -m pip install hypothesis pytest-benchmark pytest-xdist |
| 34 | +
|
| 35 | + - name: Install package editable |
| 36 | + run: python -m pip install -e . |
| 37 | + |
| 38 | + - name: Run native import smoke test |
| 39 | + run: python -c "import nns._nnscore as c; print(c.lpm(2.0, 0.0, [-2.0, -1.0, 0.5, 3.0]))" |
19 | 40 |
|
20 | | - - name: Install dependencies |
| 41 | + - name: Run invariants without Rscript |
| 42 | + run: python -m pytest -q tests/invariants |
| 43 | + |
| 44 | + - name: Run parity from committed R cache |
| 45 | + run: NNS_R_CACHE_ONLY=1 python -m pytest -q tests/parity |
| 46 | + |
| 47 | + - name: Run plotting color-fidelity tests |
| 48 | + run: python -m pytest -q tests/plotting |
| 49 | + |
| 50 | + - name: Run vignette examples |
21 | 51 | run: | |
22 | | - python -m pip install -q -U pip |
23 | | - python -m pip install -q build scikit-build-core nanobind pytest "numpy<2.5" scipy matplotlib hypothesis pytest-benchmark pytest-xdist |
24 | | - python -m pip install -q -e . |
| 52 | + if [ -f tests/docs/test_vignette_examples.py ]; then |
| 53 | + python -m pytest -q tests/docs/test_vignette_examples.py |
| 54 | + else |
| 55 | + echo "No docs vignette test present; skipping." |
| 56 | + fi |
| 57 | +
|
| 58 | + - name: Run ruff |
| 59 | + run: ruff check . |
| 60 | + |
| 61 | + - name: Run mypy |
| 62 | + run: mypy |
25 | 63 |
|
26 | | - - name: Run vignette examples with full tracebacks |
27 | | - run: python -m pytest -vv -s tests/docs/test_vignette_examples.py |
| 64 | + - name: Build distributions |
| 65 | + run: python -m build |
0 commit comments