test #686
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: test | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_call: | |
| inputs: | |
| os: | |
| description: "Comma-delineated list of OS targets to run tests on" | |
| required: false | |
| type: string | |
| workflow_dispatch: | |
| inputs: | |
| os: | |
| description: "Comma-delineated list of OS targets to run tests on" | |
| required: false | |
| type: string | |
| concurrency: | |
| group: test-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| FORCE_COLOR: "1" | |
| PYTHONUNBUFFERED: "1" | |
| permissions: {} | |
| jobs: | |
| generate-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 | |
| with: | |
| activate-environment: true | |
| enable-cache: true | |
| - id: set-matrix | |
| env: | |
| OS: ${{ inputs.os }} | |
| run: | | |
| uv run nox --session gha_matrix -- "${OS}" | |
| test: | |
| name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }} (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| needs: generate-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 | |
| with: | |
| activate-environment: true | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set Python environment for macOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| # Use the Python from the activated virtual environment | |
| echo "PYO3_PYTHON=$(which python)" >> $GITHUB_ENV | |
| - name: Run tests | |
| shell: bash | |
| env: | |
| DJANGO_VERSION: ${{ matrix.django-version }} | |
| PYTHON_VERSION: ${{ matrix.python-version }} | |
| run: | | |
| uv run nox --session "tests(python='${PYTHON_VERSION}', django='${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 |