Python package / GitHub Actions upgrades #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: pull_request | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| matrix: | |
| name: Build test matrix | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| cache: "pip" | |
| cache-dependency-path: "requirements/*.txt" | |
| - name: Run tox | |
| id: matrix | |
| run: | | |
| pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt) | |
| echo "tox_matrix=$(tox -l | fgrep -v coverage | python .github/matrix.py)" >> $GITHUB_OUTPUT | |
| outputs: | |
| tox_matrix: ${{ steps.matrix.outputs.tox_matrix }} | |
| test: | |
| name: Test -- ${{ matrix.tox_env }} | |
| runs-on: ubuntu-24.04 | |
| needs: matrix | |
| strategy: | |
| matrix: | |
| include: ${{ fromJson(needs.matrix.outputs.tox_matrix) }} | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: "pip" | |
| cache-dependency-path: "requirements/*.txt" | |
| - name: Run tests | |
| env: | |
| PGHOST: localhost | |
| PGUSER: postgres | |
| PGPASSWORD: password | |
| TOX_OVERRIDE: "testenv.passenv=PG*" | |
| PYTHON_VERSION: ${{ matrix.python }} | |
| run: | | |
| pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt) | |
| tox -e ${{ matrix.tox_env }} | |
| - name: Upload coverage data | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-data-${{ matrix.tox_env }} | |
| include-hidden-files: true | |
| path: .coverage.* | |
| if-no-files-found: ignore | |
| services: | |
| postgres: | |
| image: postgres:17-alpine | |
| env: | |
| POSTGRES_PASSWORD: password | |
| ports: | |
| - 5432:5432 | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-24.04 | |
| needs: test | |
| if: always() | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| cache: "pip" | |
| cache-dependency-path: "requirements/*.txt" | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| pattern: coverage-data-* | |
| merge-multiple: true | |
| - name: Run coverage | |
| run: | | |
| pip install $(grep -E "^(tox|tox-uv)==" requirements/local.txt) | |
| tox -e coverage | |
| tox -qq exec -e coverage -- coverage report --format=markdown >> $GITHUB_STEP_SUMMARY |