Skip to content

Commit 2ad874d

Browse files
authored
Add CI test for sphinx-intl's doc (#107)
* ci: add test for documentation * Add sphinx-lint to doc/requirements.txt * ci: add workflow_dispatch to doc.yml Allows to call manually the workflow, which is helpful for linkcheck * Add workflow file to event trigger paths * Add self to doc/requirements.txt Needed due to a import of sphinx-intl in doc/conf.py * Annotate error messages from doc.yml
1 parent d0954dc commit 2ad874d

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/doc.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Docs
2+
on:
3+
push:
4+
paths:
5+
- 'doc/'
6+
- '.github/workflows/doc.yml'
7+
pull_request:
8+
paths:
9+
- 'doc/'
10+
- '.github/workflows/doc.yml'
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
doc:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup python binary
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3'
28+
cache: 'pip'
29+
cache-dependency-path: 'doc/requirements.txt'
30+
31+
- name: Install dependencies
32+
run: pip install -r doc/requirements.txt
33+
34+
- name: Add sphinx-build problem matcher
35+
uses: sphinx-doc/[email protected]
36+
37+
- name: Add sphinx-lint problem matcher
38+
uses: rffontenelle/[email protected]
39+
40+
- name: Build docs
41+
run: make -C doc html O='--keep-going --fail-on-warning --nitpicky'
42+
43+
- name: Lint docs
44+
if: always()
45+
run: sphinx-lint doc/
46+
47+
- name: Check links
48+
if: always()
49+
run: make -C doc linkcheck O='--keep-going'

doc/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
sphinx
22
sphinx_rtd_theme>=1.3
33
sphinx-click
4+
sphinx-lint
5+
.

0 commit comments

Comments
 (0)