ci: add ruff lint and format checks #32
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: Tests | |
| on: | |
| push: | |
| pull_request: | |
| workflow_call: | |
| jobs: | |
| # Static checks: ruff lint + formatting. Runs once on a single Python | |
| # version since the result does not depend on the interpreter. | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install package with dev dependencies | |
| run: python -m pip install -e ".[dev]" | |
| - name: Ruff lint | |
| run: ruff check . | |
| - name: Ruff format check | |
| run: ruff format --check . | |
| # Test suite across all supported Python versions, plus a build check | |
| # to catch packaging errors early. Skipped if lint fails to save CI minutes. | |
| test: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package with dev dependencies | |
| run: python -m pip install -e ".[dev]" | |
| - name: Run tests | |
| run: python -m pytest tests/ -v | |
| - name: Verify package builds | |
| run: | | |
| python -m pip install build | |
| python -m build --sdist --wheel |