forked from teemtee/tmt
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.69 KB
/
doc-tests.yml
File metadata and controls
60 lines (52 loc) · 1.69 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
name: test-docs
run-name: Documentation tests
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
doc-test:
name: Sphinx Tests (${{ matrix.builder }})
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'ci | skip')"
strategy:
fail-fast: false
matrix:
builder: [ linkcheck, html, lint ]
include:
# Run default html builder with warnings as error
- builder: html
args: -W
- builder: lint
sphinx_builder: html
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-python@v6
with:
python-version: 3.x
- uses: astral-sh/setup-uv@v7
with:
activate-environment: true
- name: Install tmt[docs]
run: uv sync --frozen --extra docs
# TODO: Move this to its own extra/group
- name: Install other test dependencies
run: uv pip install sphinx-lint
if: ${{ matrix.builder == 'lint' }}
- name: Cache linkcheck results
uses: actions/cache@v5
with:
path: docs/_build/linkcheck_cache.json
key: linkcheck
if: ${{ matrix.builder == 'linkcheck' }}
- name: Run sphinx builder ${{ matrix.sphinx_builder || matrix.builder }}
run: sphinx-build -E -b ${{ matrix.sphinx_builder || matrix.builder }} ${{ matrix.args }} docs/ docs/_build
# TODO: enable all checks
# https://github.com/sphinx-contrib/sphinx-lint/issues/74
- name: Run Sphinx ReST linter
run: sphinx-lint --ignore=docs/_build docs tmt tests
if: ${{ matrix.builder == 'lint' }}