Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,8 @@ on:
- main
pull_request:
jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
linting:
name: All file linting
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/pythontest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,43 @@ jobs:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
python: ${{ steps.filter.outputs.python }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
# paths-filter needs a checkout to diff push events
- uses: actions/checkout@v7
- id: filter
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
with:
github_token: ${{ github.token }}
paths: '["**.py", ".github/workflows/pythontest.yml", "pyproject.toml", "uv.lock"]'
filters: |
python:
- '**.py'
- '.github/workflows/pythontest.yml'
- 'pyproject.toml'
- 'uv.lock'
unit_test:
name: Python unit tests
needs: pre_job
if: ${{ needs.pre_job.outputs.python == 'true' }}
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v7
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
with:
fetch-depth: 0
- name: Set up uv
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-python: true
- name: Run tests
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
run: uv run --python ${{ matrix.python-version }} --group test pytest
unit_test_eol_python:
name: Python unit tests for EOL Python versions
needs: pre_job
if: ${{ needs.pre_job.outputs.python == 'true' }}
runs-on: ubuntu-latest
strategy:
max-parallel: 5
Expand All @@ -51,12 +56,23 @@ jobs:
image: python:${{ matrix.python-version }}-buster
steps:
- uses: actions/checkout@v7
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
- name: Install dependencies and run tests
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
env:
PYTHONPATH: ${{ github.workspace }}
run: |
python -m pip install --upgrade pip
pip install "pytest>=6.2.5,<8" "jsonschema==3.2.0"
pytest
# Branch protection requires this; skipped matrix jobs report no per-version checks.
required_checks:
name: Python tests
needs:
- pre_job
- unit_test
- unit_test_eol_python
if: always()
runs-on: ubuntu-latest
steps:
- name: Fail if any needed job failed or was cancelled
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
Loading