@@ -22,12 +22,14 @@ jobs:
22
22
env :
23
23
branch_base : ' origin/${{ github.event.pull_request.base.ref }}'
24
24
branch_pr : ' origin/${{ github.event.pull_request.head.ref }}'
25
+ commits : ${{ github.event.pull_request.commits }}
25
26
refspec_base : ' +${{ github.event.pull_request.base.sha }}:remotes/origin/${{ github.event.pull_request.base.ref }}'
26
27
refspec_pr : ' +${{ github.event.pull_request.head.sha }}:remotes/origin/${{ github.event.pull_request.head.ref }}'
27
28
steps :
28
29
- name : ' Check out latest PR branch commit'
29
30
uses : actions/checkout@v4
30
31
with :
32
+ persist-credentials : false
31
33
ref : >-
32
34
${{
33
35
github.event_name == 'pull_request'
@@ -39,15 +41,15 @@ jobs:
39
41
if : github.event_name == 'pull_request'
40
42
run : |
41
43
# Fetch enough history to find a common ancestor commit (aka merge-base):
42
- git fetch origin ${{ env. refspec_pr }} --depth=$(( ${{ github.event.pull_request. commits }} + 1 )) \
44
+ git fetch origin "${ refspec_pr}" --depth=$(( commits + 1 )) \
43
45
--no-tags --prune --no-recurse-submodules
44
46
45
47
# This should get the oldest commit in the local fetched history (which may not be the commit the PR branched from):
46
- COMMON_ANCESTOR=$( git rev-list --first-parent --max-parents=0 --max-count=1 ${{ env. branch_pr }} )
48
+ COMMON_ANCESTOR=$( git rev-list --first-parent --max-parents=0 --max-count=1 "${ branch_pr}" )
47
49
DATE=$( git log --date=iso8601 --format=%cd "${COMMON_ANCESTOR}" )
48
50
49
51
# Get all commits since that commit date from the base branch (eg: master or main):
50
- git fetch origin ${{ env. refspec_base }} --shallow-since="${DATE}" \
52
+ git fetch origin "${ refspec_base}" --shallow-since="${DATE}" \
51
53
--no-tags --prune --no-recurse-submodules
52
54
- name : ' Set up Python'
53
55
uses : actions/setup-python@v5
@@ -63,42 +65,26 @@ jobs:
63
65
continue-on-error : true
64
66
run : |
65
67
set -Eeuo pipefail
66
- # Build docs with the '-n' ( nit-picky) option; write warnings to file
67
- make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going -w sphinx-warnings.txt" html
68
+ # Build docs with the nit-picky option; write warnings to file
69
+ make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning --keep-going --warning-file sphinx-warnings.txt" html
68
70
- name : ' Check warnings'
69
71
if : github.event_name == 'pull_request'
70
72
run : |
71
73
python Doc/tools/check-warnings.py \
72
- --annotate-diff '${{ env. branch_base }}' '${{ env. branch_pr }}' \
74
+ --annotate-diff "${ branch_base}" "${ branch_pr}" \
73
75
--fail-if-regression \
74
76
--fail-if-improved \
75
77
--fail-if-new-news-nit
76
78
77
- # This build doesn't use problem matchers or check annotations
78
- build_doc_oldest_supported_sphinx :
79
- name : ' Docs (Oldest Sphinx)'
80
- runs-on : ubuntu-latest
81
- timeout-minutes : 60
82
- steps :
83
- - uses : actions/checkout@v4
84
- - name : ' Set up Python'
85
- uses : actions/setup-python@v5
86
- with :
87
- python-version : ' 3.13' # known to work with Sphinx 7.2.6
88
- cache : ' pip'
89
- cache-dependency-path : ' Doc/requirements-oldest-sphinx.txt'
90
- - name : ' Install build dependencies'
91
- run : make -C Doc/ venv REQUIREMENTS="requirements-oldest-sphinx.txt"
92
- - name : ' Build HTML documentation'
93
- run : make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
94
-
95
79
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
96
80
doctest :
97
81
name : ' Doctest'
98
- runs-on : ubuntu-22 .04
82
+ runs-on : ubuntu-24 .04
99
83
timeout-minutes : 60
100
84
steps :
101
85
- uses : actions/checkout@v4
86
+ with :
87
+ persist-credentials : false
102
88
- uses : actions/cache@v4
103
89
with :
104
90
path : ~/.cache/pip
@@ -115,4 +101,4 @@ jobs:
115
101
run : make -C Doc/ PYTHON=../python venv
116
102
# Use "xvfb-run" since some doctest tests open GUI windows
117
103
- name : ' Run documentation doctest'
118
- run : xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="-W --keep-going" doctest
104
+ run : xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning --keep-going" doctest
0 commit comments