Skip to content

Commit 4f26963

Browse files
authored
pythongh-93735: Split Docs CI to speed-up the build (pythonGH-93736)
1 parent 274769c commit 4f26963

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

.github/workflows/doc.yml

+34-12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
paths:
2424
- 'Doc/**'
2525
- 'Misc/**'
26+
- '.github/workflows/doc.yml'
2627

2728
permissions:
2829
contents: read
@@ -35,6 +36,38 @@ jobs:
3536
- uses: actions/checkout@v3
3637
- name: Register Sphinx problem matcher
3738
run: echo "::add-matcher::.github/problem-matchers/sphinx.json"
39+
- name: 'Set up Python'
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: '3'
43+
cache: 'pip'
44+
cache-dependency-path: 'Doc/requirements.txt'
45+
- name: 'Install build dependencies'
46+
run: make -C Doc/ venv
47+
- name: 'Check documentation'
48+
run: make -C Doc/ check
49+
- name: 'Build HTML documentation'
50+
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
51+
- name: 'Upload'
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: doc-html
55+
path: Doc/build/html
56+
57+
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
58+
doctest:
59+
name: 'Doctest'
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v3
63+
- name: Register Sphinx problem matcher
64+
run: echo "::add-matcher::.github/problem-matchers/sphinx.json"
65+
- uses: actions/cache@v3
66+
with:
67+
path: ~/.cache/pip
68+
key: ubuntu-doc-${{ hashFiles('Doc/requirements.txt') }}
69+
restore-keys: |
70+
ubuntu-doc-
3871
- name: 'Install Dependencies'
3972
run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
4073
- name: 'Configure CPython'
@@ -43,17 +76,6 @@ jobs:
4376
run: make -j4
4477
- name: 'Install build dependencies'
4578
run: make -C Doc/ PYTHON=../python venv
46-
# Run "check doctest html" as 3 steps to get a more readable output
47-
# in the web UI
48-
- name: 'Check documentation'
49-
run: make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going" check
5079
# Use "xvfb-run" since some doctest tests open GUI windows
5180
- name: 'Run documentation doctest'
52-
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going" doctest
53-
- name: 'Build HTML documentation'
54-
run: make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going" html
55-
- name: 'Upload'
56-
uses: actions/upload-artifact@v3
57-
with:
58-
name: doc-html
59-
path: Doc/build/html
81+
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" doctest

0 commit comments

Comments
 (0)