Test Codebase #13
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: Test Codebase | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| config: | |
| name: "Compute configuration values" | |
| uses: ./.github/workflows/config.yml | |
| quality: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - config | |
| steps: | |
| - name: Checkout codebase | |
| uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ needs.config.outputs.python-version }} | |
| cache-python: true | |
| enable-cache: true | |
| cache-suffix: "optional-suffix" | |
| cache-dependency-glob: | | |
| **/uv.lock | |
| - name: Check formatting | |
| if: ${{ success() || failure() }} | |
| id: ruff-format | |
| shell: bash | |
| run: | | |
| uvx ruff@${{ needs.config.outputs.version-ruff }} format --diff | |
| - name: Check lint | |
| if: ${{ success() || failure() }} | |
| id: ruff-lint | |
| shell: bash | |
| run: | | |
| uvx ruff@${{ needs.config.outputs.version-ruff }} check --diff | |
| - name: Check Package Metadata | |
| if: ${{ success() || failure() }} | |
| id: pyroma | |
| shell: bash | |
| run: | | |
| uvx pyroma@${{ needs.config.outputs.version-pyroma }} -d . | |
| - name: Check Python Versions | |
| if: ${{ success() || failure() }} | |
| id: py-versions | |
| shell: bash | |
| run: | | |
| uvx check-python-versions@${{ needs.config.outputs.version-check-python }} . | |
| - name: Check typing | |
| if: ${{ success() || failure() }} | |
| id: typing | |
| run: | | |
| uvx mypy@${{ needs.config.outputs.version-mypy }} src | |
| - name: Report | |
| if: ${{ success() || failure() }} | |
| run: | | |
| echo '# Code Analysis' >> $GITHUB_STEP_SUMMARY | |
| echo '| Test | Status |' >> $GITHUB_STEP_SUMMARY | |
| echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY | |
| echo '| Format | ${{ steps.ruff-format.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
| echo '| Lint | ${{ steps.ruff-lint.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
| echo '| Package Metadata | ${{ steps.pyroma.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
| echo '| Python Versions | ${{ steps.py-versions.conclusion == 'failure' && '❌' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
| echo '| Typing | ${{ steps.typing.conclusion == 'failure' && '❌' || steps.typing.conclusion == 'skipped' && '⏭️' || ' ✅' }} |' >> $GITHUB_STEP_SUMMARY | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - config | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| env: | |
| python-version: ${{ matrix.python-version }} | |
| steps: | |
| - name: Checkout codebase | |
| uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache-python: true | |
| enable-cache: true | |
| cache-suffix: "optional-suffix" | |
| cache-dependency-glob: | | |
| **/uv.lock | |
| - name: Run tests | |
| run: | | |
| make test | |
| coverage: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - config | |
| steps: | |
| - name: Checkout codebase | |
| uses: actions/checkout@v6 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ needs.config.outputs.python-version }} | |
| cache-python: true | |
| enable-cache: true | |
| cache-suffix: "optional-suffix" | |
| cache-dependency-glob: | | |
| **/uv.lock | |
| - name: Run coverage | |
| run: | | |
| make test-coverage | |
| - name: Report Coverage | |
| run: | | |
| echo "# Coverage Report" >> $GITHUB_STEP_SUMMARY | |
| echo "$(uv run coverage report --format markdown)" >> $GITHUB_STEP_SUMMARY | |
| docs: | |
| name: "Generate documentation" | |
| uses: ./.github/workflows/docs.yml | |
| needs: | |
| - config | |
| with: | |
| python-version: ${{ needs.config.outputs.python-version }} | |
| docs-directory: "docs" | |
| working-directory: "." | |
| check-links: true | |
| check-vale: true |