Repository navigation
307 lines (298 loc) · 10.1 KB
/
Copy pathtest.yml
File metadata and controls
307 lines (298 loc) · 10.1 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
name: Test
# Standard testing workflow on Linux, Windows, and macOS.
permissions:
contents: read
concurrency:
group: test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
tags-ignore:
- "*"
branches: ["main"]
pull_request:
branches: ["main"]
paths:
- "src/**"
- "tests/**"
- ".github/workflows/test.yml"
- "pyproject.toml"
- "justfile"
merge_group:
workflow_call:
workflow_dispatch:
inputs:
debug:
description: "Open ssh debug session."
required: true
default: false
type: boolean
clear_cache:
description: "Clear GitHub Tool cache."
required: true
default: false
type: boolean
schedule:
# Every Sunday at 9:00 AM Los Angeles time (17:00 UTC).
- cron: "0 17 * * 0"
jobs:
test-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
dependencies:
- "lowest-direct"
- "highest"
exclude:
# test lower dependency bounds on the oldest python only
- python-version: "3.11"
dependencies: "highest"
- python-version: "3.12"
dependencies: "lowest-direct"
- python-version: "3.13"
dependencies: "lowest-direct"
- python-version: "3.14"
dependencies: "lowest-direct"
- python-version: "3.15"
dependencies: "lowest-direct"
env:
COVERAGE_FILE: linux-py${{ matrix.python-version }}.coverage
TEST_PYTHON_VERSION: ${{ matrix.python-version }}
DEPENDENCY_RESOLUTION: ${{ matrix.dependencies }}
steps:
- name: Clear Tool cache
if: ${{ github.event.inputs.clear_cache == 'true' }}
run: sudo rm -rf /opt/hostedtoolcache
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0
id: sp
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2
with:
enable-cache: false
- name: Setup Just
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3
with:
just-version: "1.58.0"
- name: Install Emacs
if: ${{ github.event.inputs.debug == 'true' }}
run: |
sudo apt install emacs
- name: Setup tmate session
if: ${{ github.event.inputs.debug == 'true' }}
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113
timeout-minutes: 60
- name: Run Unit Tests
env:
TEST_PYTHON: ${{ steps.sp.outputs.python-path }}
run: |
just test-all -p "$TEST_PYTHON" --resolution "$DEPENDENCY_RESOLUTION"
- name: Store coverage files
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: ${{ env.COVERAGE_FILE }}
path: ${{ env.COVERAGE_FILE }}
test-windows:
runs-on: windows-latest
defaults:
run:
shell: pwsh
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.15"]
dependencies:
- "lowest-direct"
- "highest"
exclude:
- python-version: "3.11"
dependencies: "highest"
- python-version: "3.15"
dependencies: "lowest-direct"
env:
COVERAGE_FILE: windows-py${{ matrix.python-version }}.coverage
TEST_PYTHON_VERSION: ${{ matrix.python-version }}
DEPENDENCY_RESOLUTION: ${{ matrix.dependencies }}
steps:
- name: Clear Tool cache
if: ${{ github.event.inputs.clear_cache == 'true' }}
run: sudo rm -rf /opt/hostedtoolcache
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0
id: sp
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2
with:
enable-cache: false
- name: Setup Just
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3
with:
just-version: "1.58.0"
- name: install-vim-windows
if: ${{ github.event.inputs.debug == 'true' }}
uses: rhysd/action-setup-vim@febef33995d6649302e9d88dda81e071b68f16a7
- name: Setup tmate session
if: ${{ github.event.inputs.debug == 'true' }}
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113
timeout-minutes: 60
- name: Run Unit Tests
env:
TEST_PYTHON: ${{ steps.sp.outputs.python-path }}
run: |
just test-all -p $env:TEST_PYTHON --resolution $env:DEPENDENCY_RESOLUTION
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Store coverage files
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: ${{ env.COVERAGE_FILE }}
path: ${{ env.COVERAGE_FILE }}
test-macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.15"]
dependencies:
- "lowest-direct"
- "highest"
exclude:
- python-version: "3.11"
dependencies: "highest"
- python-version: "3.15"
dependencies: "lowest-direct"
env:
COVERAGE_FILE: macos-py${{ matrix.python-version }}.coverage
TEST_PYTHON_VERSION: ${{ matrix.python-version }}
DEPENDENCY_RESOLUTION: ${{ matrix.dependencies }}
steps:
- name: Clear Tool cache
if: ${{ github.event.inputs.clear_cache == 'true' }}
run: sudo rm -rf /opt/hostedtoolcache
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0
id: sp
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2
with:
enable-cache: false
- name: Setup Just
run: |
brew install just
- name: install-emacs-macos
if: ${{ github.event.inputs.debug == 'true' }}
run: |
brew install emacs
- name: Setup tmate session
if: ${{ github.event.inputs.debug == 'true' }}
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113
timeout-minutes: 60
- name: Run Unit Tests
env:
TEST_PYTHON: ${{ steps.sp.outputs.python-path }}
run: |
just test-all -p "$TEST_PYTHON" --resolution "$DEPENDENCY_RESOLUTION"
- name: Store coverage files
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: ${{ env.COVERAGE_FILE }}
path: ${{ env.COVERAGE_FILE }}
test-pdf:
# compile pdfs with both pdflatex and xelatex and build the pdf documentation
runs-on: ubuntu-latest
env:
REQUIRE_LATEX: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0
id: sp
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2
with:
enable-cache: false
- name: Setup Just
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3
with:
just-version: "1.58.0"
- name: Install LaTeX
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
latexmk \
texlive-latex-recommended \
texlive-latex-extra \
texlive-fonts-recommended \
texlive-xetex \
tex-gyre \
fonts-freefont-otf \
xindy
- name: Run PDF Tests
env:
TEST_PYTHON: ${{ steps.sp.outputs.python-path }}
run: |
just test-all -p "$TEST_PYTHON"
- name: Build PDF Docs
run: |
just build-docs-pdf
- name: Store PDF docs
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: sphinxcontrib-enum-docs-pdf
path: doc/build/pdf/sphinxcontrib-enum.pdf
coverage-combine:
needs: [test-linux, test-windows, test-macos]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # for oidc authentication to codecov
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2
with:
enable-cache: false
- name: Setup Just
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3
with:
just-version: "1.58.0"
- name: Get coverage files
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333
with:
pattern: "*.coverage"
merge-multiple: true
- run: ls -la *.coverage
- run: just coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5
with:
use_oidc: true
files: ./coverage.xml