Repository navigation
244 lines (216 loc) · 7 KB
/
Copy pathbuild-test.yml
File metadata and controls
244 lines (216 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
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
name: Build and Test
on:
push:
branches:
- main
tags:
- "*"
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
uses: ./.github/workflows/lint.yml
rust_tests:
name: Rust tests - ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.runner }}
container: ${{ matrix.platform.container }}
strategy:
matrix:
platform:
- name: Linux x86_64
runner: ubuntu-24.04
- name: Linux ARM64
runner: ubuntu-24.04-arm
- name: Windows x64
runner: windows-latest
- name: Windows ARM64
runner: windows-11-arm
- name: macOS x86_64
runner: macos-15-intel
- name: macOS ARM64
runner: macos-15
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/cache-rust-build
- uses: ./.github/actions/install-uv
- uses: ./.github/actions/install-python-deps
- uses: ./.github/actions/run-cargo-tests
build:
needs: rust_tests
name: Build Wheels - ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.runner }}
container: ${{ matrix.platform.container }}
strategy:
matrix:
platform:
- name: linux-x86_64
runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
before-script: python3 -m ensurepip && cat /etc/os-release && yum install clang -y
manylinux: "2_28"
is-musl: false
- name: linux-aarch64
runner: ubuntu-24.04
target: aarch64-unknown-linux-gnu
skip_tests: true
before-script: |
apt-get update && \
apt-get install --assume-yes --no-install-recommends crossbuild-essential-arm64
manylinux: "2_28"
is-musl: false
- name: linux-musl-x86_64
runner: ubuntu-24.04
target: x86_64-unknown-linux-musl
container: docker://messense/rust-musl-cross:x86_64-musl
before-script: cat /etc/os-release && apt install clang -y
manylinux: musllinux_1_2
is-musl: true
- name: windows-x64
runner: windows-latest
target: x86_64-pc-windows-msvc
is-musl: false
- name: windows-arm64
runner: windows-11-arm
target: aarch64-pc-windows-msvc
is-musl: false
- name: macos-x86_64
runner: macos-15-intel
target: x86_64-apple-darwin
is-musl: false
- name: macos-arm64
runner: macos-15
target: aarch64-apple-darwin
is-musl: false
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/cache-rust-build
- uses: ./.github/actions/build-wheel
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
manylinux: ${{ matrix.platform.manylinux }}
# set maturin's container to "off" when using the job-level container (musl)
maturin-container: ${{ matrix.platform.is-musl && 'off' || '' }}
before-script-linux: ${{ matrix.platform.before-script }}
- uses: ./.github/actions/upload-wheels
with:
name: wheels-${{ matrix.platform.name }}
path: dist
sdist:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Build sdist
uses: ./.github/actions/build-wheel
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: ./.github/actions/upload-wheels
with:
name: wheels-sdist
path: dist
test:
needs: build
name: Test - ${{ matrix.config.name }}
runs-on: ${{ matrix.config.runner }}
strategy:
fail-fast: false
matrix:
config:
# Platform tests with Python 3.12
- name: Linux x86_64
runner: ubuntu-24.04
platform-name: linux-x86_64
python-version: "3.12"
is-min-deps: false
- name: Linux ARM64
runner: ubuntu-24.04-arm
platform-name: linux-aarch64
python-version: "3.12"
is-min-deps: false
- name: Windows
runner: windows-latest
platform-name: windows-x64
python-version: "3.12"
is-min-deps: false
- name: Windows ARM64
runner: windows-11-arm
platform-name: windows-arm64
python-version: "3.12"
is-min-deps: false
- name: macOS x86_64
runner: macos-15-intel
platform-name: macos-x86_64
python-version: "3.12"
is-min-deps: false
- name: macOS ARM64
runner: macos-15
platform-name: macos-arm64
python-version: "3.12"
is-min-deps: false
# Additional Python versions for Linux x86_64
- name: Python 3.10
runner: ubuntu-24.04
platform-name: linux-x86_64
python-version: "3.10"
is-min-deps: false
- name: Python 3.11
runner: ubuntu-24.04
platform-name: linux-x86_64
python-version: "3.11"
is-min-deps: false
- name: Python 3.13
runner: ubuntu-24.04
platform-name: linux-x86_64
python-version: "3.13"
is-min-deps: false
- name: Python 3.14
runner: ubuntu-24.04
platform-name: linux-x86_64
python-version: "3.14"
is-min-deps: false
# - name: Python 3.15
# runner: ubuntu-24.04
# platform-name: linux-x86_64
# python-version: "3.15"
# is-min-deps: false
# Minimum dependencies test
- name: Min Dependencies
runner: ubuntu-24.04
platform-name: linux-x86_64
python-version: "3.10"
is-min-deps: true
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/install-uv
with:
python-version: ${{ matrix.config.python-version }}
- uses: ./.github/actions/download-wheels
with:
name: wheels-${{ matrix.config.platform-name }}
path: dist
- uses: ./.github/actions/run-python-tests
with:
min-deps: ${{ matrix.config.is-min-deps }}
test-musl:
needs: build
name: Test - Linux Musl
runs-on: ubuntu-24.04
container: ghcr.io/astral-sh/uv:0.9.11-alpine
steps:
- uses: actions/checkout@v6
- name: Install dependencies
shell: sh
run: |
apk add tar python3 py3-pip py3-psutil gcc python3-dev musl-dev linux-headers
- uses: ./.github/actions/install-uv
with:
python-version: "3.12"
- uses: ./.github/actions/download-wheels
with:
name: wheels-linux-musl-x86_64
path: dist
- name: Run musl tests
uses: ./.github/actions/run-python-tests