-
Notifications
You must be signed in to change notification settings - Fork 1
208 lines (205 loc) · 7 KB
/
ci-python.yml
File metadata and controls
208 lines (205 loc) · 7 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
---
name: Python CI
"on":
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- released
env:
DEBIAN_FRONTEND: noninteractive
CARGO_INCREMENTAL: "false"
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
lint:
strategy:
fail-fast: false
matrix:
job:
- black
- mypy
- ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v5
- run: uv sync --all-groups
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
- uses: taiki-e/install-action@0d865d5cc6d507df4765f1f866bfae8bab4e2a73 # v2.69.7
with:
tool: just
- run: just ci-lint-${{ matrix.job }}
build:
strategy:
fail-fast: false
matrix:
python-version:
- "3.11"
- "pypy3.11"
- "3.12"
- "3.13"
- "3.13t"
- "3.14"
- "3.14t"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v5
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --all-groups
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
- uses: taiki-e/install-action@0d865d5cc6d507df4765f1f866bfae8bab4e2a73 # v2.69.7
with:
tool: just
- run: just ci-build-python
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: python-${{ matrix.python-version }}-build
path: target/wheels/
test:
needs: build
strategy:
fail-fast: false
matrix:
job:
- mit
# Several issues in k5test preventing us from running kadmind with it currently
# - h5l
python-version:
- "3.11"
- "pypy3.11"
- "3.12"
- "3.13"
- "3.13t"
- "3.14"
- "3.14t"
runs-on: ubuntu-latest
env:
KRB5_TRACE: /dev/stderr
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v5
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --all-groups
- uses: taiki-e/install-action@0d865d5cc6d507df4765f1f866bfae8bab4e2a73 # v2.69.7
with:
tool: just
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: python-${{ matrix.python-version }}-build
path: target/wheels/
- run: |
PATH="/usr/lib/heimdal-servers:$PATH" just ci-test-python-${{ matrix.job }}
check-python:
if: always()
needs:
- lint
- build
- test
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
with:
jobs: ${{ toJSON(needs) }}
build-sdist:
needs: check-python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v5
- run: uv sync --all-groups
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
- uses: taiki-e/install-action@0d865d5cc6d507df4765f1f866bfae8bab4e2a73 # v2.69.7
with:
tool: just
- run: just ci-build-python-sdist
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: python-cibw-sdist
path: dist
build-wheels-matrix:
needs: check-python
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v5
- run: uv sync --all-groups
- id: set-matrix
name: compute matrix
run: |
MATRIX="$(
{
uv run cibuildwheel --print-build-identifiers --platform linux --archs x86_64 \
| sed 's/.*/{"cibw-only": "&", "os": "ubuntu-latest"}/' \
&& uv run cibuildwheel --print-build-identifiers --platform linux --archs aarch64 \
| sed 's/.*/{"cibw-only": "&", "os": "ubuntu-24.04-arm"}/' \
&& uv run cibuildwheel --print-build-identifiers --platform macos --archs x86_64 \
| sed 's/.*/{"cibw-only": "&", "os": "macos-15-intel" }/' \
&& uv run cibuildwheel --print-build-identifiers --platform macos --archs arm64 \
| sed 's/.*/{"cibw-only": "&", "os": "macos-latest" }/'
} | jq --slurp --compact-output '{"include": .}'
)"
echo matrix="$MATRIX" >> "$GITHUB_OUTPUT"
build-wheels:
needs: build-wheels-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.build-wheels-matrix.outputs.matrix) }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- uses: pypa/cibuildwheel@ee02a1537ce3071a004a6b08c41e72f0fdc42d9a # v3.4.0
with:
only: "${{ matrix.cibw-only }}"
env:
RUSTC_WRAPPER: ""
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: python-cibw-wheels-${{ matrix.cibw-only }}
path: ./wheelhouse/*.whl
merge-dist-artifacts:
needs:
- build-sdist
- build-wheels
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact/merge@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: python-dist
pattern: python-cibw-*
delete-merged: false
release:
needs:
- check-python
- merge-dist-artifacts
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/kadmin/version/')
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: python-cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1