Skip to content

Generic-based typing for Validator classes #231

Generic-based typing for Validator classes

Generic-based typing for Validator classes #231

Workflow file for this run

# GitHub Actions workflow for running unit tests (using tox, pytest and flake8) on each push or pull request to main.
name: Unit tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: Run unit tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install --upgrade pip tox
- name: Run test suite with tox
# Run tox using the version of Python in `PATH`
run: tox run -e clean,py,report,flake8,mypy -- --junit-xml=reports/pytest_${{ matrix.python-version }}.xml
- name: Upload test result artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: pytest-results-${{ matrix.python-version }}
path: reports/pytest_${{ matrix.python-version }}.xml
report:
name: Publish unit test reports
runs-on: ubuntu-24.04
# Job depends on test results
needs: test
# Do not run this job in pull requests from a forked repository (because the test-reporter would fail)
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v4
- name: Download test result artifacts
uses: actions/download-artifact@v4
with:
path: reports/
pattern: pytest-results-*
merge-multiple: true
- name: Publish unit test reports
uses: dorny/test-reporter@v2.1.1
if: success() || failure()
with:
name: Pytest Report
path: reports/pytest_*.xml
reporter: java-junit