[pre-commit.ci] pre-commit autoupdate (#130) #370
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: test | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_call: | |
| concurrency: | |
| group: test-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| env: | |
| PYTHONUNBUFFERED: "1" | |
| FORCE_COLOR: "1" | |
| jobs: | |
| generate-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.8" | |
| allow-prereleases: true | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip uv | |
| python -m uv pip install --system nox | |
| - id: set-matrix | |
| run: | | |
| echo "matrix=$(python -m nox -l --json | jq -c '[.[] | select(.name == "tests") | {"python-version": .python, "django-version": .call_spec.django}] | {include: .}')" >> $GITHUB_OUTPUT | |
| test: | |
| name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} | |
| runs-on: ubuntu-latest | |
| needs: generate-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "${{ matrix.python-version }}" | |
| allow-prereleases: true | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip uv | |
| python -m uv pip install --system nox | |
| - name: Run tests | |
| run: | | |
| nox --session "tests(python='${{ matrix.python-version }}', django='${{ matrix.django-version }}')" | |
| tests: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: always() | |
| steps: | |
| - name: OK | |
| if: ${{ !(contains(needs.*.result, 'failure')) }} | |
| run: exit 0 | |
| - name: Fail | |
| if: ${{ contains(needs.*.result, 'failure') }} | |
| run: exit 1 | |
| types: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| allow-prereleases: true | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip uv | |
| python -m uv pip install --system nox | |
| - name: Run mypy | |
| run: | | |
| python -m nox --session "mypy" | |
| coverage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.8" | |
| allow-prereleases: true | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -U pip uv | |
| python -m uv pip install --system nox | |
| - name: Run coverage | |
| run: | | |
| python -m nox --session "coverage" |