Skip to content

Commit 3c7cf3e

Browse files
AA-Turnermiss-islington
authored andcommitted
pythongh-93735: Split Docs CI to speed-up the build (pythonGH-93736)
(cherry picked from commit 4f26963) Co-authored-by: Adam Turner <[email protected]>
1 parent 73c8f3f commit 3c7cf3e

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
jobs:
2829
build_doc:
@@ -32,6 +33,38 @@ jobs:
3233
- uses: actions/checkout@v3
3334
- name: Register Sphinx problem matcher
3435
run: echo "::add-matcher::.github/problem-matchers/sphinx.json"
36+
- name: 'Set up Python'
37+
uses: actions/setup-python@v4
38+
with:
39+
python-version: '3'
40+
cache: 'pip'
41+
cache-dependency-path: 'Doc/requirements.txt'
42+
- name: 'Install build dependencies'
43+
run: make -C Doc/ venv
44+
- name: 'Check documentation'
45+
run: make -C Doc/ check
46+
- name: 'Build HTML documentation'
47+
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
48+
- name: 'Upload'
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: doc-html
52+
path: Doc/build/html
53+
54+
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
55+
doctest:
56+
name: 'Doctest'
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v3
60+
- name: Register Sphinx problem matcher
61+
run: echo "::add-matcher::.github/problem-matchers/sphinx.json"
62+
- uses: actions/cache@v3
63+
with:
64+
path: ~/.cache/pip
65+
key: ubuntu-doc-${{ hashFiles('Doc/requirements.txt') }}
66+
restore-keys: |
67+
ubuntu-doc-
3568
- name: 'Install Dependencies'
3669
run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
3770
- name: 'Configure CPython'
@@ -40,17 +73,6 @@ jobs:
4073
run: make -j4
4174
- name: 'Install build dependencies'
4275
run: make -C Doc/ PYTHON=../python venv
43-
# Run "check doctest html" as 3 steps to get a more readable output
44-
# in the web UI
45-
- name: 'Check documentation'
46-
run: make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going" check
4776
# Use "xvfb-run" since some doctest tests open GUI windows
4877
- name: 'Run documentation doctest'
49-
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going" doctest
50-
- name: 'Build HTML documentation'
51-
run: make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going" html
52-
- name: 'Upload'
53-
uses: actions/upload-artifact@v3
54-
with:
55-
name: doc-html
56-
path: Doc/build/html
78+
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" doctest

0 commit comments

Comments
 (0)