-
Notifications
You must be signed in to change notification settings - Fork 53
186 lines (169 loc) · 5.47 KB
/
Copy pathci.yml
File metadata and controls
186 lines (169 loc) · 5.47 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
name: CI
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '1 0 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
python-version: '3.14'
enable-cache: false
- run: uv build
unyt-module-test-function:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Python
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
python-version: '3.14'
enable-cache: false
- run: uv run --group test python -c "import unyt ; unyt.test()"
test:
runs-on: ${{ matrix.os }}
needs: [build]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
- '3.14'
sync-args: [null]
pytest-args: [null]
label: [null]
# Test all on ubuntu, test ends on macos and windows
include:
- os: macos-latest
python-version: '3.10'
sync-args: null
pytest-args: null
label: null
- os: windows-latest
python-version: '3.10'
sync-args: null
pytest-args: null
label: null
- os: macos-latest
python-version: '3.14'
sync-args: null
pytest-args: null
- os: windows-latest
python-version: '3.14'
sync-args: null
pytest-args: null
label: null
# with integration deps
- os: ubuntu-latest
python-version: '3.14'
sync-args: --group integration
pytest-args: null
label: integration
# with lowest dependencies
- os: ubuntu-22.04
python-version: '3.10.0'
sync-args: --resolution=lowest --group integration
pytest-args: null
label: oldestdeps
# with doctests
- os: ubuntu-latest
python-version: '3.10'
sync-args: --group doc
pytest-args: --doctest-modules --doctest-plus
label: doctests
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
python-version: ${{ matrix.python-version }}
enable-cache: false
- name: Install test env
run: uv sync --group covcheck ${{ matrix.sync-args }}
- name: Run tests
shell: bash # for windows compat
run: |
uv run --no-sync coverage run --parallel-mode -m \
pytest --color=yes ${{ matrix.pytest-args }}
- name: Upload coverage data
# only using reports from ubuntu because
# combining reports from multiple platforms is tricky
if: startsWith( matrix.os , 'ubuntu' )
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: unyt_coverage_data-${{matrix.os}}-${{matrix.python-version}}-${{matrix.label}}
path: .coverage.*
if-no-files-found: ignore
include-hidden-files: true
coverage:
name: Combine & check coverage.
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
python-version: '3.14'
enable-cache: false
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: unyt_coverage_data-*
merge-multiple: true
- name: Check coverage
run: |
uv tool install coverage
coverage combine
coverage html --skip-covered --skip-empty
coverage report --skip-covered --format=markdown >> "$GITHUB_STEP_SUMMARY"
coverage report --fail-under=99
- name: Upload HTML report
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: unyt_coverage_report
path: htmlcov
docs:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Python
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
python-version: '3.10'
enable-cache: false
- run: uv sync --group doc --group test
- name: Build docs
run: |
uv run --no-sync --directory=docs \
python -m sphinx -M html "." "_build" -W
- name: Upload build
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: unyt_docs
path: docs/_build/html
if-no-files-found: error