Merge pull request #120 from bsweger/dependabot/uv/py-updates-748d260b0d #257
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 | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_COLOR: "1" | |
| PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
| PIP_NO_PYTHON_VERSION_WARNING: "1" | |
| jobs: | |
| generate-nox-sessions: | |
| name: Get nox session lists to use for matrices in other jobs | |
| runs-on: ubuntu-latest | |
| outputs: | |
| nox_tests: ${{ steps.set-matrix.outputs.nox_tests }} | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv π | |
| uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0 | |
| with: | |
| version: "0.9.16" | |
| - name: Set nox session matrices π§© | |
| id: set-matrix | |
| shell: bash | |
| run: | | |
| echo nox_tests=$(uvx nox --session tests --json -l | jq -c '[.[].session]') | tee --append $GITHUB_OUTPUT | |
| lint: | |
| name: Lint and type check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv π | |
| uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0 | |
| with: | |
| version: "0.9.16" | |
| - name: Lint π§Ή | |
| run: uvx nox --session lint | |
| - name: Type Check π§ | |
| run: uvx nox --session typecheck | |
| coverage: | |
| name: Generate coverage reports & fail if below threshold | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv π | |
| uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0 | |
| with: | |
| version: "0.9.16" | |
| - name: Generate coverage report π | |
| # The coverage session runs the test suite using the latest stable | |
| # python version and uses that output to generate the coverage report | |
| # (as opposed to merging coverage reports from all python versions) | |
| run: uvx nox --session coverage >> $GITHUB_STEP_SUMMARY | |
| - name: Upload HTML report if coverage check fails π€ | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: html-cov-report | |
| path: htmlcov | |
| if: ${{ failure() }} | |
| tests: | |
| name: Run tests | |
| needs: generate-nox-sessions | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| nox_tests: ${{ fromJson(needs.generate-nox-sessions.outputs.nox_tests) }} | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv π | |
| uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0 | |
| with: | |
| version: "0.9.16" | |
| - name: Run nox test session ${{ matrix.nox_tests }} π§ͺ | |
| run: uvx nox --session ${{ matrix.nox_tests }} | |
| doc_build: | |
| name: Test docs build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| steps: | |
| - name: Checkout ποΈ | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv π | |
| uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b #v7.3.0 | |
| with: | |
| version: "0.9.16" | |
| - name: Run nox docs session π | |
| run: uvx nox --session docs |