Adding a test framework for sphinx-simplepdf #33
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: CI | |
| on: [pull_request] | |
| jobs: | |
| pre-commit: | |
| name: pre-commit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - uses: pre-commit/[email protected] | |
| docs: | |
| name: docs-${{ matrix.target }}-py${{ matrix.python }}-${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [html, pdf] | |
| python: ["3.10", "3.11", "3.12", "3.13"] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| include: | |
| - target: html | |
| builder: html | |
| - target: pdf | |
| builder: simplepdf | |
| exclude: | |
| - target: pdf | |
| os: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install WeasyPrint dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev libcairo2 | |
| - name: Install WeasyPrint dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install pango libffi | |
| - name: Install WeasyPrint dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| $env:PATH = "C:\msys64\mingw64\bin;$env:PATH" | |
| C:\msys64\usr\bin\pacman -S --noconfirm mingw-w64-x86_64-pango mingw-w64-x86_64-gdk-pixbuf2 | |
| shell: pwsh | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python | |
| run: uv python install ${{ matrix.python }} | |
| - name: Install docs dependencies | |
| run: uv sync --group docs | |
| - name: Build docs (${{ matrix.target }}) | |
| run: uv run sphinx-build -M ${{ matrix.builder }} docs docs/_build | |
| shell: bash | |
| env: | |
| PATH: ${{ runner.os == 'Windows' && 'C:\msys64\mingw64\bin;' || '' }}${{ env.PATH }} | |
| tests: | |
| name: tests-${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install WeasyPrint dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev libcairo2 | |
| - name: Install WeasyPrint dependencies (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install pango libffi | |
| - name: Install WeasyPrint dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| $env:PATH = "C:\msys64\mingw64\bin;$env:PATH" | |
| C:\msys64\usr\bin\pacman -S --noconfirm mingw-w64-x86_64-pango mingw-w64-x86_64-gdk-pixbuf2 | |
| shell: pwsh | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install tests dependencies | |
| run: uv sync --group dev | |
| - name: Testing (${{ matrix.os }}) | |
| run: uv run tox | |
| shell: bash | |
| env: | |
| PATH: ${{ runner.os == 'Windows' && 'C:\msys64\mingw64\bin;' || '' }}${{ env.PATH }} | |
| all_good: | |
| if: ${{ !cancelled() }} | |
| needs: | |
| - pre-commit | |
| - docs | |
| - tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |