Create djls-dev crate and centralize Python linking build scripts (#119) #367
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" | |
jobs: | |
generate-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: true | |
pyproject-file: pyproject.toml | |
- id: set-matrix | |
run: | | |
uv run noxfile.py --session gha_matrix -- "${{ inputs.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) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: true | |
pyproject-file: pyproject.toml | |
- name: Run tests | |
run: | | |
uv run noxfile.py --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 |