Repository navigation
52 lines (43 loc) · 1.59 KB
/
Copy pathdocs.yml
File metadata and controls
52 lines (43 loc) · 1.59 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
# Build check for the documentation site.
#
# Read the Docs does the hosting (see .readthedocs.yaml). This workflow only catches
# breakage before merge and after changes land on main: `--strict` turns a broken link, a page
# missing from the nav or a docstring mkdocstrings cannot render into a failed check.
name: Docs
on:
push:
branches: [main, 'fix/**']
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
FORCE_COLOR: "1"
jobs:
build:
name: mkdocs build --strict
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: "3.13"
# The package itself is installed too, because mkdocstrings reads the docstrings
# from it. The dev group is included because some examples are pytest tests.
- run: uv sync --frozen --no-default-groups --group docs --group dev
- name: Build the site
run: uv run --no-sync mkdocs build --strict
env:
NO_MKDOCS_2_WARNING: "1"
# Every ```python block in docs/ is executed, so an example that drifts from the
# real API fails review instead of misleading a reader.
- name: Run the documentation examples
run: uv run --no-sync python scripts/check_docs_examples.py