-
Notifications
You must be signed in to change notification settings - Fork 7
105 lines (82 loc) · 2.79 KB
/
docs.yml
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
name: docs
on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Create virtualenv
run: python3 -m venv .venv
- name: Install dependencies
run: |
source .venv/bin/activate
python -m pip install .
python -m pip install -r docs/requirements.txt
- name: Linkcheck
working-directory: docs
run: |
source ../.venv/bin/activate
set +e
make linkcheck
exit_code=$?
set -e
if [ $exit_code -eq 0 ]; then
echo -e "\n\n=================\nAll links are valid!"
echo "# :heavy_check_mark: Sphinx links" >> $GITHUB_STEP_SUMMARY
echo "All links are valid!" >> $GITHUB_STEP_SUMMARY
else
echo -e "\n\n=================\nFound broken links. Look at the build logs.\n"
echo "# :x: Sphinx links" >> $GITHUB_STEP_SUMMARY
echo "Found broken links. Look at the build logs for additional information." >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat _build/linkcheck/output.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
exit $exit_code
check-warnings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Create virtualenv
run: python3 -m venv .venv
- name: Install dependencies
run: |
source .venv/bin/activate
python -m pip install .
python -m pip install -r docs/requirements.txt
- name: Check warnings/errors
working-directory: docs
run: |
source ../.venv/bin/activate
set +e
make htmlstrict
exit_code=$?
set -e
if [ $exit_code -eq 0 ]; then
echo -e "\n\n=================\nNo warnings or errors detected!"
echo "# :heavy_check_mark: Sphinx warnings/errors" >> $GITHUB_STEP_SUMMARY
echo "No errors or warnings detected!" >> $GITHUB_STEP_SUMMARY
else
echo -e "\n\n=================\nWarnings and or errors detected; See the summary bellow:\n"
cat _build/htmlstrict/output.txt
echo "# :x: Sphinx warnings/errors" >> $GITHUB_STEP_SUMMARY
echo "Found some warnings or errors:" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat _build/htmlstrict/output.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
exit $exit_code