Skip to content

Commit b62d37c

Browse files
authored
[3.10] gh-93735: Split Docs CI to speed-up the build (GH-93736) (GH-93833)
(cherry picked from commit 4f26963) Co-authored-by: Adam Turner <[email protected]>
1 parent 968b238 commit b62d37c

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

.github/workflows/doc.yml

+35-7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,38 @@ jobs:
2828
- uses: actions/checkout@v3
2929
- name: Register Sphinx problem matcher
3030
run: echo "::add-matcher::.github/problem-matchers/sphinx.json"
31+
- name: 'Set up Python'
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: '3'
35+
cache: 'pip'
36+
cache-dependency-path: 'Doc/requirements.txt'
37+
- name: 'Install build dependencies'
38+
run: make -C Doc/ venv
39+
- name: 'Check documentation'
40+
run: make -C Doc/ suspicious
41+
- name: 'Build HTML documentation'
42+
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
43+
- name: 'Upload'
44+
uses: actions/upload-artifact@v3
45+
with:
46+
name: doc-html
47+
path: Doc/build/html
48+
49+
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
50+
doctest:
51+
name: 'Doctest'
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v3
55+
- name: Register Sphinx problem matcher
56+
run: echo "::add-matcher::.github/problem-matchers/sphinx.json"
57+
- uses: actions/cache@v3
58+
with:
59+
path: ~/.cache/pip
60+
key: ubuntu-doc-${{ hashFiles('Doc/requirements.txt') }}
61+
restore-keys: |
62+
ubuntu-doc-
3163
- name: 'Install Dependencies'
3264
run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
3365
- name: 'Configure CPython'
@@ -36,10 +68,6 @@ jobs:
3668
run: make -j4
3769
- name: 'Install build dependencies'
3870
run: make -C Doc/ PYTHON=../python venv
39-
- name: 'Build documentation'
40-
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going" doctest html suspicious
41-
- name: 'Upload'
42-
uses: actions/upload-artifact@v3
43-
with:
44-
name: doc-html
45-
path: Doc/build/html
71+
# Use "xvfb-run" since some doctest tests open GUI windows
72+
- name: 'Run documentation doctest'
73+
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" doctest

0 commit comments

Comments
 (0)