Skip to content

Sync Project with generate-demo nox session and test CI/CD #1

Sync Project with generate-demo nox session and test CI/CD

Sync Project with generate-demo nox session and test CI/CD #1

Workflow file for this run

# .github/workflows/test-python.yml
# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Test Python Code
on:
pull_request:
paths:
- "src/**/*.py"
- "tests/**/*.py"
- "noxfile.py"
- "pyproject.toml"
- ".coveragerc"
- ".github/workflows/test-python.yml"
push:
branches:
- main
- master
paths:
- "src/**/*.py"
- "tests/**/*.py"
- "noxfile.py"
- "pyproject.toml"
- ".coveragerc"
- ".github/workflows/test-python.yml"
workflow_dispatch:
jobs:
test-python:
name: Run Python Tests on ${{ matrix.os }}/${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run test suite
run: uvx nox -s test-python
- name: Upload test reports
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}-py${{ matrix.python-version }}
path: tests/results/*.xml
retention-days: 5
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.os }}-py${{ matrix.python-version }}
path: coverage.xml
retention-days: 5