Use reusable lint workflow #186
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: | |
| pull_request: | |
| push: | |
| branches: [main, test] | |
| merge_group: | |
| jobs: | |
| pre-commit: | |
| name: Lint | |
| uses: tskit-dev/.github/.github/workflows/lint.yml@v1 | |
| test: | |
| name: Python | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| python: [ 3.9, 3.12 ] | |
| os: [ macos-latest, ubuntu-24.04, windows-latest ] | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@0.12.1 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Checkout | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| submodules: true | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| version: "0.8.15" | |
| - name: Install dependencies | |
| run: | | |
| uv venv | |
| uv pip install -r pyproject.toml --extra test | |
| - name: Run tests | |
| run: | | |
| uv run --no-sync python -m pytest -xv --cov=tszip --cov-report=xml --cov-branch -n2 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5.4.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: true |