[Python-checkins] [3.10] gh-93735: Split Docs CI to speed-up the build (GH-93736) (GH-93833)

ambv webhook-mailer at python.org
Thu Jun 16 06:17:14 EDT 2022


https://github.com/python/cpython/commit/b62d37c4a5016b3239c72c147de7f04a9be66e02
commit: b62d37c4a5016b3239c72c147de7f04a9be66e02
branch: 3.10
author: Adam Turner <9087854+AA-Turner at users.noreply.github.com>
committer: ambv <lukasz at langa.pl>
date: 2022-06-16T12:17:10+02:00
summary:

[3.10] gh-93735: Split Docs CI to speed-up the build (GH-93736) (GH-93833)

(cherry picked from commit 4f26963526f386bba84de8e14962163bfd5da955)

Co-authored-by: Adam Turner <9087854+AA-Turner at users.noreply.github.com>

files:
M .github/workflows/doc.yml

diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml
index 36b9f9f1d3497..e2501589d6e6a 100644
--- a/.github/workflows/doc.yml
+++ b/.github/workflows/doc.yml
@@ -28,6 +28,38 @@ jobs:
     - uses: actions/checkout at v3
     - name: Register Sphinx problem matcher
       run: echo "::add-matcher::.github/problem-matchers/sphinx.json"
+    - name: 'Set up Python'
+      uses: actions/setup-python at v4
+      with:
+        python-version: '3'
+        cache: 'pip'
+        cache-dependency-path: 'Doc/requirements.txt'
+    - name: 'Install build dependencies'
+      run: make -C Doc/ venv
+    - name: 'Check documentation'
+      run: make -C Doc/ suspicious
+    - name: 'Build HTML documentation'
+      run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
+    - name: 'Upload'
+      uses: actions/upload-artifact at v3
+      with:
+        name: doc-html
+        path: Doc/build/html
+
+  # Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
+  doctest:
+    name: 'Doctest'
+    runs-on: ubuntu-latest
+    steps:
+    - uses: actions/checkout at v3
+    - name: Register Sphinx problem matcher
+      run: echo "::add-matcher::.github/problem-matchers/sphinx.json"
+    - uses: actions/cache at v3
+      with:
+        path: ~/.cache/pip
+        key: ubuntu-doc-${{ hashFiles('Doc/requirements.txt') }}
+        restore-keys: |
+          ubuntu-doc-
     - name: 'Install Dependencies'
       run: sudo ./.github/workflows/posix-deps-apt.sh && sudo apt-get install wamerican
     - name: 'Configure CPython'
@@ -36,10 +68,6 @@ jobs:
       run: make -j4
     - name: 'Install build dependencies'
       run: make -C Doc/ PYTHON=../python venv
-    - name: 'Build documentation'
-      run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going" doctest html suspicious
-    - name: 'Upload'
-      uses: actions/upload-artifact at v3
-      with:
-        name: doc-html
-        path: Doc/build/html
+    # Use "xvfb-run" since some doctest tests open GUI windows
+    - name: 'Run documentation doctest'
+      run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" doctest



More information about the Python-checkins mailing list