Try codecov test analysis #80
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '**' | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| name: Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| python-version: | |
| - '3.10' | |
| - '3.11' | |
| - '3.12' | |
| - '3.13' | |
| - '3.14' | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Install uv & Python ${{ matrix.python-version }} | |
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| activate-environment: true | |
| # TODO: Do we need `allow-prereleases: true`? | |
| - name: Install test dependencies | |
| run: uv sync --group test --frozen | |
| - name: Run tests for ${{ matrix.python-version }} | |
| run: pytest --cov --junitxml=junit.xml -o junit_family=legacy | |
| - name: Upload coverage data | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: coverage-data-${{ matrix.python-version }} | |
| path: ${{ github.workspace }}/.coverage.* | |
| include-hidden-files: true | |
| if-no-files-found: error | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| report_type: test_results | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| release: | |
| if: success() && startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-24.04 | |
| environment: release | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| - name: Build | |
| run: uv build | |
| - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 |