FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/.github/workflows/reusable-docs.yml at master · blhsing/cpython · GitHub
blhsing
/
cpython
Public
forked from
python/cpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
14
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
.github
/
workflows
/
reusable-docs.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
147 lines (136 loc) · 5.45 KB
Breadcrumbs
cpython
/
.github
/
workflows
/
reusable-docs.yml
Copy path
File metadata and controls
147 lines (136 loc) · 5.45 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name
:
Reusable Docs
on
:
workflow_call
:
workflow_dispatch
:
permissions
:
contents
:
read
concurrency
:
group
:
${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress
:
true
env
:
FORCE_COLOR
:
1
jobs
:
build-doc
:
name
:
'
Docs
'
runs-on
:
ubuntu-latest
timeout-minutes
:
60
env
:
branch_base
:
'
origin/${{ github.event.pull_request.base.ref }}
'
branch_pr
:
'
origin/${{ github.event.pull_request.head.ref }}
'
commits
:
${{ github.event.pull_request.commits }}
refspec_base
:
'
+${{ github.event.pull_request.base.sha }}:remotes/origin/${{ github.event.pull_request.base.ref }}
'
refspec_pr
:
'
+${{ github.event.pull_request.head.sha }}:remotes/origin/${{ github.event.pull_request.head.ref }}
'
steps
:
-
name
:
'
Check out latest PR branch commit
'
uses
:
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
#
v6.0.2
with
:
persist-credentials
:
false
ref
:
>-
${{
github.event_name == 'pull_request'
&& github.event.pull_request.head.sha
|| ''
}}
#
Adapted from https://github.com/actions/checkout/issues/520#issuecomment-1167205721
-
name
:
'
Fetch commits to get branch diff
'
if
:
github.event_name == 'pull_request'
run
:
|
# Fetch enough history to find a common ancestor commit (aka merge-base):
git fetch origin "${refspec_pr}" --depth=$(( commits + 1 )) \
--no-tags --prune --no-recurse-submodules
# This should get the oldest commit in the local fetched history (which may not be the commit the PR branched from):
COMMON_ANCESTOR=$( git rev-list --first-parent --max-parents=0 --max-count=1 "${branch_pr}" )
DATE=$( git log --date=iso8601 --format=%cd "${COMMON_ANCESTOR}" )
# Get all commits since that commit date from the base branch (eg: master or main):
git fetch origin "${refspec_base}" --shallow-since="${DATE}" \
--no-tags --prune --no-recurse-submodules
-
name
:
'
Set up Python
'
uses
:
actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
#
v6.2.0
with
:
python-version
:
'
3
'
cache
:
'
pip
'
cache-dependency-path
:
'
Doc/pylock.toml
'
-
name
:
'
Install build dependencies
'
run
:
make -C Doc/ venv
#
To annotate PRs with Sphinx nitpicks (missing references)
-
name
:
'
Build HTML documentation
'
continue-on-error
:
true
run
:
|
set -Eeuo pipefail
# Build docs with the nit-picky option; write warnings to file
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --warning-file sphinx-warnings.txt" html
-
name
:
'
Check warnings
'
if
:
github.event_name == 'pull_request'
run
:
|
python Doc/tools/check-warnings.py \
--annotate-diff "${branch_base}" "${branch_pr}" \
--fail-if-regression \
--fail-if-improved \
--fail-if-new-news-nit
-
name
:
'
Collect HTML IDs
'
if
:
github.event_name == 'pull_request'
run
:
python Doc/tools/check-html-ids.py collect Doc/build/html -o Doc/build/html-ids-head.json.gz
-
name
:
'
Upload HTML IDs
'
if
:
github.event_name == 'pull_request'
uses
:
actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
#
v7.0.0
with
:
name
:
html-ids-head
path
:
Doc/build/html-ids-head.json.gz
archive
:
false
check-html-ids
:
name
:
'
Check for removed HTML IDs
'
needs
:
build-doc
if
:
github.event_name == 'pull_request'
uses
:
./.github/workflows/reusable-check-html-ids.yml
#
Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
doctest
:
name
:
'
Doctest
'
runs-on
:
ubuntu-24.04
timeout-minutes
:
60
steps
:
-
uses
:
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
#
v6.0.2
with
:
persist-credentials
:
false
-
uses
:
actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7
#
v5.0.4
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 --no-install-recommends wamerican
-
name
:
'
Configure CPython
'
run
:
./configure --with-pydebug
-
name
:
'
Build CPython
'
run
:
make -j4
-
name
:
'
Install build dependencies
'
run
:
make -C Doc/ PYTHON=../python venv
#
Use "xvfb-run" since some doctest tests open GUI windows
-
name
:
'
Run documentation doctest
'
run
:
xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning" doctest
check-epub
:
name
:
'
Check EPUB
'
runs-on
:
ubuntu-latest
timeout-minutes
:
30
steps
:
-
uses
:
actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
#
v6.0.2
with
:
persist-credentials
:
false
-
name
:
'
Set up Python
'
uses
:
actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
#
v6.2.0
with
:
python-version
:
'
3
'
cache
:
'
pip
'
cache-dependency-path
:
'
Doc/requirements.txt
'
-
name
:
'
Install build dependencies
'
run
:
|
make -C Doc/ venv
python -m pip install epubcheck
-
name
:
'
Build EPUB documentation
'
run
:
make -C Doc/ PYTHON=../python epub
-
name
:
'
Run epubcheck
'
continue-on-error
:
true
run
:
epubcheck Doc/build/epub/Python.epub &> Doc/epubcheck.txt
-
run
:
cat Doc/epubcheck.txt
-
name
:
'
Check for fatal errors in EPUB
'
run
:
python Doc/tools/check-epub.py
Back
|
FazBrowse Home
|
New Git URL