Migrate repository structure, tooling, CI/CD and docs to the uv zensical stack #6
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: Main | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| workflow_dispatch: | |
| concurrency: | |
| group: >- | |
| ${{ github.workflow }}-${{ github.ref_type }}- | |
| ${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| with: | |
| # deep clone incl. tags so hatch-vcs can derive the version | |
| fetch-depth: 0 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Run checks | |
| run: make check | |
| tests-and-type-check: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # full python range on ubuntu; boundary versions cross-platform | |
| # (preserves the coverage of the previous CI matrix) | |
| os: [ubuntu-latest] | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| include: | |
| - os: macos-latest | |
| python-version: "3.10" | |
| - os: macos-latest | |
| python-version: "3.13" | |
| - os: windows-latest | |
| python-version: "3.10" | |
| - os: windows-latest | |
| python-version: "3.13" | |
| fail-fast: false | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| with: | |
| # deep clone incl. tags so hatch-vcs can derive the version | |
| fetch-depth: 0 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # no `make` on the windows runners, so invoke the tools directly | |
| - name: Run tests | |
| run: uv run python -m pytest --cov --cov-config=pyproject.toml --cov-report=xml | |
| - name: Check typing | |
| run: uv run ty check | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }} | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| check-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| with: | |
| # deep clone incl. tags so hatch-vcs can derive the version | |
| fetch-depth: 0 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Check if documentation can be built | |
| run: uv run zensical build -s |