Genera improvements #159
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-unit | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
test-unit-matrix-job: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
include: | |
- python-version: 3.8 | |
allow-failure: false | |
- python-version: 3.9 | |
allow-failure: false | |
- python-version: 3.10 | |
allow-failure: false | |
- python-version: 3.11 | |
allow-failure: false | |
- python-version: 3.12 | |
allow-failure: false | |
- python-version: 3.13 | |
allow-failure: false | |
continue-on-error: ${{ matrix.allow-failure }} | |
name: Python ${{ matrix.python-version }} unit tests | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install -e .[dev] | |
- name: Run tests and code coverage | |
run: | | |
coverage run --source=src -m pytest tests/test_unit_*.py | |
coverage report -m | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
test-unit-job: | |
needs: test-unit-matrix-job | |
runs-on: ubuntu-latest | |
steps: | |
- name: test-unit-job | |
run: echo "All unit tests passed." |