Skip to content

Initial commit

Initial commit #1

Workflow file for this run

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 }}
enable-cache: false
- name: Restore uv cache
uses: actions/cache@v5
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ needs.config.outputs.python-version }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ needs.config.outputs.python-version }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}-${{ needs.config.outputs.python-version }}
- 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: |
uv sync --all-extras
uv run 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", "3.15"]
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 }}
enable-cache: false
- name: Restore uv cache
uses: actions/cache@v5
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}-${{ matrix.python-version }}
- 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 }}
enable-cache: false
- name: Restore uv cache
uses: actions/cache@v5
with:
path: ${{ env.UV_CACHE_DIR }}
key: uv-${{ runner.os }}-${{ needs.config.outputs.python-version }}-${{ hashFiles('uv.lock') }}
restore-keys: |
uv-${{ runner.os }}-${{ needs.config.outputs.python-version }}-${{ hashFiles('uv.lock') }}
uv-${{ runner.os }}-${{ needs.config.outputs.python-version }}
- 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: "docs"
check-links: true
check-vale: true