-
Notifications
You must be signed in to change notification settings - Fork 1.2k
149 lines (118 loc) · 4.33 KB
/
test.yml
File metadata and controls
149 lines (118 loc) · 4.33 KB
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
148
149
name: Test
on: pull_request
jobs:
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies with pip
run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt
- name: Test doc8
run: make test
- name: Test doc tools
run: make test-tools
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies with pip
run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt
- name: Lint
run: make lint
spellcheck:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies with pip
run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt
- name: Spellcheck
run: make spellcheck
build:
needs: [test, lint, spellcheck]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Install dependencies with pip
run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt
- name: Build the docs
run: make html
- name: Upload document artifacts
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: html-artifacts-${{ github.event.pull_request.number }}
path: build/html
retention-days: 30 # default 90
compression-level: 9 # maximum compression, default 6
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
- name: Find HTML artifacts link comment
uses: peter-evans/find-comment@v3
id: find-comment
# Skip if PR from fork
if: github.repository == github.event.pull_request.head.repo.full_name
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: "HTML artifacts:"
- name: Create or update HTML artifacts link comment
uses: peter-evans/create-or-update-comment@v4
# Skip if PR from fork
if: github.repository == github.event.pull_request.head.repo.full_name
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
HTML artifacts: ${{ steps.artifact-upload-step.outputs.artifact-url }}.
To view the resulting site:
1. Click on the above link to download the artifacts archive
2. Extract it
3. Open `html-artifacts-${{ github.event.pull_request.number }}/index.html` in your favorite browser
edit-mode: replace
multi-build:
needs: [test, lint, spellcheck]
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
# Create a fake remote ref matching the target branch name
- name: Setup branch for multiversion
run: |
TARGET_BRANCH="${{ github.base_ref }}"
echo "PR target branch: $TARGET_BRANCH"
# Create a remote ref that sphinx-multiversion will find
git update-ref "refs/remotes/origin/$TARGET_BRANCH" HEAD
# Verify the ref was created
echo "Created refs:"
git show-ref | grep "$TARGET_BRANCH"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Install dependencies with pip
run: pip install --no-warn-script-location --user -r requirements.txt -c constraints.txt
- name: Build the docs
run: make multiversion