ci: run tests in parallel with pytest-xdist #27
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: CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # full history so setuptools-scm can read tags | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: astral-sh/setup-uv@v8.0.0 | |
| with: | |
| cache-suffix: ${{ matrix.python-version }} | |
| - run: uv sync --all-extras --dev | |
| - name: Lint | |
| run: uv run ruff check . | |
| - name: Type check | |
| run: uv run mypy smoothify/ | |
| - name: Test | |
| # -n 2 overrides the local `-n auto` default: GitHub runners have 4 | |
| # vCPUs and some tests spawn smoothify's own worker pool, so a smaller | |
| # fan-out avoids oversubscribing the runner. | |
| run: uv run pytest tests/ -n 2 -x -q | |
| - name: Notebook smoke test | |
| if: matrix.python-version == '3.11' | |
| run: uv run pytest --nbmake examples/*.ipynb -n 2 -q |