🧱 static integration testing #48
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 | |
permissions: read-all | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [main] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
UV_LOCKED: 1 | |
# Many color libraries just need this to be set to any value, but at least | |
# one distinguishes color depth, where "3" -> "256-bit color". | |
FORCE_COLOR: 3 | |
jobs: | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install uv | |
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1 | |
- name: ruff | |
run: | | |
uv run ruff check --output-format=github | |
uv run ruff format --check | |
- name: mypy | |
run: uv run mypy --tb --no-incremental --cache-dir=/dev/null src | |
# TODO: (based)pyright | |
test_runtime: | |
name: runtime tests | |
runs-on: ${{ matrix.runs-on }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11", "3.12", "3.13"] | |
runs-on: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install uv | |
uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Test package | |
run: >- | |
uv run --group=test_runtime | |
pytest --cov --cov-report=xml --cov-report=term --durations=20 | |
- name: Upload coverage report | |
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
test_integration_numpy: | |
name: integration tests (numpy) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
numpy-version: ["1.25.0", "1.25.2", "1.26.4", "2.0.2", "2.1.3", "2.2.6", "2.3.1"] | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1 | |
with: | |
python-version: "3.11" | |
activate-environment: true | |
- name: install deps | |
run: | | |
uv sync --no-editable --group=mypy | |
uv pip install numpy==${{ matrix.numpy-version }} | |
# NOTE: `uv run --with=...` will be ignored by mypy (and `--isolated` does not help) | |
- name: mypy | |
run: > | |
uv run --no-sync --active | |
mypy --tb --no-incremental --cache-dir=/dev/null tests/integration/test_numpy.pyi | |
# TODO: (based)pyright | |
# TODO: integration tests for other libs |