chore: Use pytest-cov for coverage reporting #153
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: lint-and-test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| with: | |
| python-version: "3.14" | |
| - name: Lint documentation | |
| run: uv run doc8 docs/source | |
| lint-code: | |
| runs-on: ubuntu-latest | |
| name: Lint code | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| with: | |
| python-version: "3.14" | |
| - name: Lint style | |
| run: uv run ruff check | |
| lint-typing: | |
| runs-on: ubuntu-latest | |
| name: Lint type annotations | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| with: | |
| python-version: "3.14" | |
| - name: Lint typing | |
| run: uv run poe check-types | |
| test: | |
| runs-on: ubuntu-latest | |
| name: Run tests | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Test | |
| run: uv run poe test | |
| env: | |
| COVERAGE_FILE: .coverage.${{ matrix.python-version }} | |
| - name: Upload coverage data | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| include-hidden-files: true | |
| name: coverage-${{ matrix.python-version }} | |
| path: .coverage* | |
| coverage: | |
| runs-on: ubuntu-latest | |
| name: Report coverage | |
| needs: | |
| - test | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| - name: Download coverage data | |
| uses: actions/download-artifact@v8 | |
| with: | |
| pattern: coverage-* | |
| merge-multiple: true | |
| - name: Combine coverage data | |
| run: uv run poe cov-combine | |
| - name: Export coverage reports | |
| run: uv run poe cov-xml | |
| - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| package: | |
| name: Build & verify package | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: hynek/build-and-inspect-python-package@d44ca7d91762de7a7d5436ddae667c6da6d1c3df # v2.18.0 |