Update test management with tox and supported Python versions #41
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: Tests | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| test: | |
| name: Test Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Run tests with coverage | |
| run: uv run pytest --cov=toon_format --cov-report=xml --cov-report=term --cov-report=html --cov-fail-under=85 | |
| - name: Run linting | |
| run: uv run ruff check . | |
| - name: Run type checking | |
| run: uv run mypy src/toon_format | |
| - name: Upload coverage reports as artifact | |
| uses: actions/upload-artifact@v4 | |
| if: matrix.python-version == '3.14' | |
| with: | |
| name: coverage-reports | |
| path: | | |
| coverage.xml | |
| htmlcov/ | |
| retention-days: 30 | |
| - name: Coverage comment on PR | |
| uses: py-cov-action/python-coverage-comment-action@v3 | |
| if: matrix.python-version == '3.14' && github.event_name == 'pull_request' | |
| with: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| MINIMUM_GREEN: 90 | |
| MINIMUM_ORANGE: 85 |