fix CI combined coverage #172
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 | |
| on: | |
| push: | |
| schedule: | |
| - cron: '0 12 1 * *' # 12:00, first day of the month | |
| pull_request: | |
| jobs: | |
| lint-and-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.9 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: 3.9 | |
| - name: Run linters | |
| run: uvx --with tox-uv tox r -e lint | |
| - name: Build docs | |
| run: uvx --with tox-uv tox r -e docs | |
| - name: Update docs | |
| if: github.ref_type == 'tag' | |
| run: uvx --with tox-uv tox r -e docs-deploy -- --force | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| enable-cache: true | |
| - name: Run tests | |
| env: | |
| COVERAGE_FILE: .coverage/coverage.${{ matrix.python-version }} | |
| run: uvx --with tox-uv tox r -e py | |
| - name: Store coverage files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-${{ matrix.python-version }} | |
| path: .coverage | |
| include-hidden-files: true | |
| build-and-release: | |
| needs: [test, lint-and-docs] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.13 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| python-version: 3.13 | |
| - name: Build package | |
| run: uv build | |
| - name: Get coverage files | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: coverage-* | |
| path: .coverage | |
| merge-multiple: true | |
| - name: Combined coverage report | |
| run: uvx --with tox-uv tox r -e report | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| draft: true | |
| body_path: README.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |