wip #305
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: Test Suite | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: tests-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Fast tests on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install package and test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ".[dev]" | |
| - name: Cache test benchmark data | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.temp }}/airr_benchmark | |
| key: airr-benchmark-${{ hashFiles('tests/prepare_airr_benchmark_data.py') }} | |
| restore-keys: | | |
| airr-benchmark- | |
| - name: Copy tests to temp directory | |
| run: >- | |
| python -c "import pathlib, shutil; | |
| src = pathlib.Path(r'${{ github.workspace }}') / 'tests'; | |
| dst = pathlib.Path(r'${{ runner.temp }}') / 'tests'; | |
| shutil.rmtree(dst, ignore_errors=True); | |
| shutil.copytree(src, dst)" | |
| - name: Run fast test suite | |
| working-directory: ${{ runner.temp }} | |
| run: python -m pytest tests -m "not benchmark and not integration" -q | |
| test-heavy: | |
| name: Heavy tests on ${{ matrix.os }} | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/dev' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install package and test dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ".[dev]" | |
| - name: Cache test benchmark data | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ runner.temp }}/airr_benchmark | |
| key: airr-benchmark-${{ hashFiles('tests/prepare_airr_benchmark_data.py') }} | |
| restore-keys: | | |
| airr-benchmark- | |
| - name: Copy tests to temp directory | |
| run: >- | |
| python -c "import pathlib, shutil; | |
| src = pathlib.Path(r'${{ github.workspace }}') / 'tests'; | |
| dst = pathlib.Path(r'${{ runner.temp }}') / 'tests'; | |
| shutil.rmtree(dst, ignore_errors=True); | |
| shutil.copytree(src, dst)" | |
| - name: Run benchmark and integration suites | |
| env: | |
| RUN_BENCHMARKS: "1" | |
| RUN_INTEGRATION: "1" | |
| # Keep CI heavy job stable across hosted runner pools by avoiding | |
| # very-slow benchmarks that are primarily exploratory diagnostics. | |
| MIRPY_BENCH_WORKERS: "1,4" | |
| MIRPY_BENCHMARK_SCALE: "0.35" | |
| MIRPY_ALICE_BENCH_SUBSAMPLES: "5000,10000" | |
| # CI runners have 4 vCPUs, so parallel speedup is lower than on a | |
| # developer workstation with 8+ cores. These env vars widen the | |
| # thresholds so flaky timing assertions don't mask real regressions. | |
| MIRPY_ALICE_PGEN_BENCH_MIN_SPEEDUP: "1.5" | |
| MIRPY_BENCH_PGEN_MIN_THROUGHPUT: "100" | |
| MIRPY_BENCH_OVERLAP_1MM_MAX_S: "0.15" | |
| MIRPY_BENCH_OVERLAP_EXACT_MAX_S: "0.01" | |
| MIRPY_BENCH_VDJBET_MOCK_MAX_S: "30.0" | |
| MIRPY_BENCH_SYNTH_SMALL_CAP_S: "900" | |
| MIRPY_BENCH_TCRNET_REAL_MAX_SECONDS: "1800" | |
| working-directory: ${{ runner.temp }} | |
| run: python -m pytest tests -m "(benchmark or integration) and not very_slow_benchmark" -q |