Update latest release in doc #4011
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build_wheels: | |
| name: Build and test on ${{ matrix.os }}${{ matrix.numpy-version && format(' (numpy {0})', matrix.numpy-version) || matrix.python-version && format(' (python {0})', matrix.python-version) || '' }} | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| CMAKE_GENERATOR: Ninja | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ["3.12"] | |
| numpy-version: [null] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: "3.12" | |
| numpy-version: "1.26" | |
| - os: ubuntu-latest | |
| python-version: "3.14" | |
| numpy-version: null | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install sccache (Windows) | |
| if: runner.os == 'Windows' | |
| run: choco install sccache --yes | |
| - name: Cache sccache (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/cache@v6 | |
| with: | |
| path: C:\Users\runneradmin\AppData\Local\sccache | |
| key: sccache-${{ runner.os }}-${{ github.sha }} | |
| restore-keys: | | |
| sccache-${{ runner.os }}- | |
| - name: Cache pip (Windows) | |
| if: runner.os == 'Windows' | |
| uses: actions/cache@v6 | |
| with: | |
| path: C:\Users\runneradmin\AppData\Local\pip\Cache | |
| key: pip-${{ runner.os }}-${{ hashFiles('pyproject.toml') }} | |
| restore-keys: | | |
| pip-${{ runner.os }}- | |
| - name: Install Ninja | |
| run: pip install ninja | |
| - name: Add LLVM to PATH (Windows) | |
| if: runner.os == 'Windows' | |
| run: echo "C:\\Program Files\\LLVM\\bin" >> $env:GITHUB_PATH | |
| - name: Install specific numpy version | |
| if: matrix.numpy-version | |
| run: pip install "numpy==${{ matrix.numpy-version }}.*" | |
| - name: Build (Windows) | |
| if: runner.os == 'Windows' | |
| id: build_windows | |
| run: pip install -e . --group test | |
| env: | |
| CMAKE_C_COMPILER_LAUNCHER: sccache | |
| CMAKE_CXX_COMPILER_LAUNCHER: sccache | |
| SCCACHE_DIR: C:\Users\runneradmin\AppData\Local\sccache | |
| CC: clang-cl | |
| CXX: clang-cl | |
| CMAKE_BUILD_PARALLEL_LEVEL: 8 | |
| SKBUILD_PARALLEL_LEVEL: 8 | |
| - name: Build (non-Windows) | |
| if: runner.os != 'Windows' | |
| id: build_non_windows | |
| run: pip install -e . --group test | |
| - name: Test (Windows) | |
| if: runner.os == 'Windows' | |
| run: python -m pytest -m "not heavy and not network" --durations=25 | |
| # env: | |
| # BLOSC_NTHREADS: "1" | |
| # NUMEXPR_NUM_THREADS: "1" | |
| # OMP_NUM_THREADS: "1" | |
| - name: Test (non-Windows) | |
| if: runner.os != 'Windows' | |
| run: python -m pytest -m "not heavy and not network" --durations=25 | |
| # The network tests talk to a live Caterva2 server and were 24 of the 25 | |
| # slowest tests in *both* the Windows and Linux jobs, with near-identical | |
| # times -- so what they measure is server round-trip latency, not anything | |
| # about the OS. Running them on Linux alone therefore loses no signal, and | |
| # stops five jobs per push hammering a third-party service. | |
| # | |
| # --dist load, not the loadfile default: these are latency-bound and | |
| # independent, so per-file pinning parks ~165 s of test_c2array_expr.py on | |
| # one worker while the rest idle. `load` is unsafe for the suite at large | |
| # (see pytest.ini) but the modules it breaks are not network-marked, so | |
| # they are not in this selection at all. | |
| # | |
| # -n 8 on a 4-core runner: these tests wait on sockets rather than compute, | |
| # so workers well past the core count still help. 8 is the point of | |
| # diminishing returns, not a round number -- the floor is the single | |
| # slowest test (test_mix_operands, ~42 s), which no amount of workers beats. | |
| # | |
| # The condition names one matrix entry rather than testing `runner.os`: | |
| # three of the five jobs are ubuntu, so `runner.os == 'Linux'` ran this | |
| # three times per push. | |
| - name: Test network access | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && !matrix.numpy-version | |
| run: python -m pytest -m "network and not heavy" -n 8 --dist load --durations=10 |