Merge pull request #46 from richardkoehler/docs/update-docs #84
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 - Lint and Type Check | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - "**" | |
| jobs: | |
| workflow-lint: | |
| name: Workflow lint (actionlint) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Lint GitHub workflow files | |
| uses: rhysd/actionlint@v1.7.8 | |
| dependency-audit: | |
| name: Dependency audit (uv audit) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 | |
| with: | |
| python-version: "3.12" | |
| enable-cache: true | |
| - name: Audit dependencies for vulnerabilities | |
| run: | | |
| uv audit | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 | |
| with: | |
| python-version: "3.12" | |
| enable-cache: true | |
| - name: Sync dependencies | |
| run: | | |
| uv sync --locked --dev | |
| - name: Lint | |
| run: | | |
| uv run ruff check . | |
| - name: Format | |
| run: | | |
| uv run ruff format --check . | |
| type-check: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 | |
| with: | |
| python-version: "3.12" | |
| enable-cache: true | |
| - name: Sync dependencies | |
| run: | | |
| uv sync --locked --dev | |
| - name: Type check | |
| run: | | |
| uv run ty check . | |
| test: | |
| name: Tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| - os: windows-latest | |
| - os: macos-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 | |
| with: | |
| python-version: "3.12" | |
| enable-cache: true | |
| - name: Sync dependencies | |
| run: | | |
| uv sync --locked --dev | |
| # PySide6 links libEGL even for offscreen; ubuntu-latest images omit it by default. | |
| - name: Install Qt EGL/XCB dependencies (Ubuntu only) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| libegl1 \ | |
| libgl1 \ | |
| libxkbcommon0 \ | |
| libdbus-1-3 | |
| - name: Run pytest | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| run: | | |
| uv run pytest --cov-fail-under=48 | |
| docs: | |
| name: Docs (build + linkcheck) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 | |
| with: | |
| python-version: "3.12" | |
| enable-cache: true | |
| - name: Sync docs dependency group | |
| run: | | |
| uv sync --locked --group docs --no-dev | |
| - name: Build HTML docs (warnings are errors) | |
| run: | | |
| uv run sphinx-build -b html -W --keep-going docs docs/_build/html | |
| - name: Link check (non-blocking) | |
| continue-on-error: true | |
| run: | | |
| uv run sphinx-build -b linkcheck docs docs/_build/linkcheck | |
| - name: Upload rendered HTML artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-html-${{ github.sha }} | |
| path: docs/_build/html | |
| if-no-files-found: error | |
| - name: Upload linkcheck report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-linkcheck-${{ github.sha }} | |
| path: docs/_build/linkcheck | |
| if-no-files-found: warn | |
| package-briefcase-zip: | |
| name: Package Briefcase ZIP (Windows) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 | |
| with: | |
| python-version: "3.12" | |
| enable-cache: true | |
| - name: Sync dependencies (incl. build / Briefcase) | |
| run: | | |
| uv sync --locked --dev --group build | |
| - name: Briefcase create / build / package (zip) | |
| env: | |
| QT_QPA_PLATFORM: offscreen | |
| run: | | |
| uv run briefcase create windows app | |
| uv run briefcase build windows app | |
| uv run briefcase package windows -p zip | |
| - name: Upload Briefcase ZIP artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: briefcase-windows-zip-${{ github.sha }} | |
| path: dist/ | |
| if-no-files-found: warn |