-
Notifications
You must be signed in to change notification settings - Fork 0
216 lines (180 loc) · 6.44 KB
/
Copy pathtests.yml
File metadata and controls
216 lines (180 loc) · 6.44 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: ci
on:
push:
pull_request:
jobs:
qa:
runs-on: ubuntu-latest
# `gp-furo-theme`'s build backend (`sphinx_vite_builder.build`) runs
# `pnpm exec vite build` during editable installs, which the qa
# runners can't satisfy (no pnpm/Node). qa's purpose is lint/types/
# tests against Python sources — the rendered theme isn't exercised
# here — so we set the documented escape-hatch env var on the whole
# job. The backend then short-circuits and the install succeeds.
# Test suites that build a Sphinx project with html_theme="gp-furo"
# behave the same as they do on a stock checkout without vite —
# Sphinx silently skips the missing static entries (no -W in qa).
env:
SPHINX_VITE_BUILDER_SKIP: "1"
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install workspace dependencies
run: uv sync --all-packages --all-extras --group dev
- name: Print Python versions
run: |
python -V
uv run python -V
uv run pytest --version
- name: Lint with ruff check
run: uv run ruff check .
- name: Format with ruff format
run: uv run ruff format . --check
- name: Type check with mypy
run: uv run mypy .
- name: Validate package runtime versions
if: matrix.python-version == '3.14'
run: uv run python scripts/ci/package_tools.py check-versions
- name: Test with pytest
if: matrix.python-version != '3.14'
run: uv run pytest
- name: Test with pytest and coverage
if: matrix.python-version == '3.14'
run: uv run pytest --cov=./ --cov-report=xml
- uses: codecov/codecov-action@v6
if: matrix.python-version == '3.14'
with:
token: ${{ secrets.CODECOV_TOKEN }}
docs:
runs-on: ubuntu-latest
needs: qa
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
# `gp-furo-theme`'s build backend (`sphinx_vite_builder.build`)
# runs vite during editable install, populating the gitignored
# `static/` tree so the docs build below picks up real CSS / JS.
# The pnpm/Node steps below give the backend a working toolchain.
- name: Set up pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- name: Install workspace dependencies
run: uv sync --all-packages --all-extras --group dev
- name: Build documentation with warnings as errors
run: uv run sphinx-build -W -b dirhtml docs docs/_build/html
packages:
runs-on: ubuntu-latest
needs: qa
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
# `gp-furo-theme`'s sdist + wheel both go through
# `sphinx_vite_builder.build`, which runs vite. The wheels
# produced here are consumed by the smoke matrix below — they
# MUST contain populated `static/`, otherwise downstream smoke
# installs render unstyled. pnpm + Node satisfy that toolchain
# requirement; the backend's wheel-from-sdist short-circuit
# (no `web/` in unpacked sdist → assume pre-baked) means smoke
# jobs themselves don't need this setup.
- name: Set up pnpm
uses: pnpm/action-setup@v6
with:
version: 10
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
- name: Install workspace dependencies
run: uv sync --all-packages --all-extras --group dev
- name: Validate package runtime versions
run: uv run python scripts/ci/package_tools.py check-versions
- name: Build all workspace packages
run: uv build --all-packages --out-dir dist --clear
- name: Validate distributions with twine
run: uvx twine check dist/*
- name: Upload package distributions
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
smoke:
runs-on: ubuntu-latest
needs: packages
strategy:
fail-fast: false
matrix:
target:
- root-install
- gp-sphinx
- sphinx-gp-theme
- sphinx-fonts
- sphinx-autodoc-argparse
- sphinx-autodoc-docutils
- sphinx-autodoc-sphinx
- sphinx-autodoc-pytest-fixtures
- sphinx-autodoc-api-style
- sphinx-autodoc-fastmcp
- sphinx-autodoc-typehints-gp
- sphinx-ux-badges
- sphinx-ux-autodoc-layout
- sphinx-vite-builder
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.14
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Download package distributions
if: matrix.target != 'root-install'
uses: actions/download-artifact@v8
with:
name: dist
path: dist
- name: Smoke test root bootstrap install
if: matrix.target == 'root-install'
# The root install transitively builds `gp-furo-theme`, which
# routes through `sphinx_vite_builder.build`. The smoke target
# only verifies that imports resolve — it doesn't exercise the
# rendered theme — so we skip the vite invocation.
env:
SPHINX_VITE_BUILDER_SKIP: "1"
run: python scripts/ci/package_tools.py smoke root-install
- name: Smoke test built package artifact
if: matrix.target != 'root-install'
run: python scripts/ci/package_tools.py smoke "${{ matrix.target }}" --dist-dir dist