forked from useblocks/sphinx-simplepdf
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (99 loc) · 3.4 KB
/
ci.yaml
File metadata and controls
99 lines (99 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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/action@v3.0.1
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) }}