40
40
41
41
- run : python3 -m pip install --user -r test/requirements.txt -r integration/requirements.txt mypy
42
42
43
- - run : pytest -s -rxX -v -n 2 test
43
+ - run : pytest -s -rxX -v -n 4 test
44
44
env :
45
45
PYTHONMALLOC : " debug"
46
46
60
60
61
61
manylinux_2_17_amd64 :
62
62
runs-on : ubuntu-24.04
63
+ timeout-minutes : 10
63
64
strategy :
64
65
fail-fast : false
65
66
matrix :
67
+ arch : [
68
+ {
69
+ cc : " clang" ,
70
+ cflags : " -Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm" ,
71
+ features : " avx512,no-panic,unstable-simd,yyjson" ,
72
+ ldflags : " -fuse-ld=lld -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow" ,
73
+ rustflags : " -C linker=clang -C link-arg=-fuse-ld=lld -C linker-plugin-lto -C lto=fat -C link-arg=-Wl,-zrelro,-znow -Z mir-opt-level=4 -Z virtual-function-elimination -Z threads=4 -D warnings" ,
74
+ tag : null,
75
+ target : " x86_64-unknown-linux-gnu" ,
76
+ },
77
+ ]
66
78
python : [
67
79
{ interpreter: 'python3.13', package: 'python3.13' },
68
80
{ interpreter: 'python3.12', package: 'python3.12' },
@@ -74,48 +86,153 @@ jobs:
74
86
env :
75
87
PYTHON : " ${{ matrix.python.interpreter }}"
76
88
PYTHON_PACKAGE : " ${{ matrix.python.package }}"
77
- TARGET : " x86_64-unknown-linux-gnu "
78
- CC : " clang "
89
+ TARGET : " ${{ matrix.arch.target }} "
90
+ CC : " ${{ matrix.arch.cc }} "
79
91
VENV : " .venv"
80
- CFLAGS : " -Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm"
81
- LDFLAGS : " -fuse-ld=lld -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow"
82
- RUSTFLAGS : " -C linker=clang -C link-arg=-fuse-ld=lld -C linker-plugin-lto -C lto=fat -C link-arg=-Wl,-zrelro,-znow -Z mir-opt-level=4 -Z virtual-function-elimination -Z threads=2 -D warnings"
83
- PATH : " /__w/orjson/orjson/.venv/bin:/github/home/.cargo/bin:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
84
- container :
85
- image : fedora:42
92
+ FEATURES : " ${{ matrix.arch.features }}"
93
+ CFLAGS : " ${{ matrix.arch.cflags }}"
94
+ LDFLAGS : " ${{ matrix.arch.ldflags }}"
95
+ RUSTFLAGS : " ${{ matrix.arch.rustflags }}"
96
+ CARGO_TARGET_DIR : " /tmp/orjson"
86
97
steps :
87
98
88
99
- name : cpuinfo
89
100
run : cat /proc/cpuinfo
90
101
91
- - name : Build environment pre-clone
92
- run : dnf install -y git
93
-
94
102
- uses : actions/checkout@v4
95
103
96
- - name : Build environment post-clone
104
+ - name : setup-qemu-container
105
+ uses : sandervocke/setup-qemu-container@v1
106
+ with :
107
+ container : registry.fedoraproject.org/fedora:42
108
+ arch : ${{ matrix.arch.tag }}
109
+ podman_args : " -v .:/orjson -v /tmp:/tmp --workdir /orjson"
110
+
111
+ - name : setup-shell-wrapper
112
+ uses : sandervocke/setup-shell-wrapper@v1
113
+
114
+ - name : Build and test
115
+ shell : wrap-shell {0}
116
+ env :
117
+ WRAP_SHELL : run-in-container.sh
97
118
run : |
119
+ set -eou pipefail
120
+
121
+ mkdir dist
122
+
123
+ export PATH="/root/.cargo/bin:/home/runner/work/orjson/orjson/.venv:/home/runner/.cargo/bin:$PATH"
124
+
98
125
./script/install-fedora
99
126
127
+ source "${VENV}/bin/activate"
128
+
100
129
maturin build --release --strip \
101
- --features=avx512,no-panic,unstable-simd,yyjson \
130
+ --features="${FEATURES}" \
102
131
--compatibility=manylinux_2_17 \
103
132
--interpreter="${PYTHON}" \
104
133
--target="${TARGET}"
105
134
106
- uv pip install target /wheels/orjson*.whl
135
+ uv pip install ${CARGO_TARGET_DIR} /wheels/orjson*.whl
107
136
108
- pytest -s -rxX -v -n 2 test
137
+ pytest -s -rxX -v -n 4 test
109
138
./integration/run thread
110
139
./integration/run http
111
140
./integration/run init
112
141
142
+ cp ${CARGO_TARGET_DIR}/wheels/orjson*.whl dist
143
+
113
144
- name : Store wheels
114
145
if : " startsWith(github.ref, 'refs/tags/')"
115
146
uses : actions/upload-artifact@v4
116
147
with :
117
148
name : orjson_manylinux_2_17_amd64_${{ matrix.python.interpreter }}
118
- path : target/wheels
149
+ path : dist
150
+ overwrite : true
151
+ retention-days : 1
152
+
153
+
154
+ manylinux_2_17_aarch64 :
155
+ runs-on : ubuntu-24.04
156
+ timeout-minutes : 45
157
+ strategy :
158
+ fail-fast : false
159
+ matrix :
160
+ arch : [
161
+ {
162
+ cc : " clang" ,
163
+ cflags : " -Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm" ,
164
+ features : " no-panic,unstable-simd,yyjson" ,
165
+ ldflags : " -fuse-ld=lld -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow" ,
166
+ rustflags : " -C linker=clang -C link-arg=-fuse-ld=lld -C linker-plugin-lto -C lto=fat -C link-arg=-Wl,-zrelro,-znow -Z mir-opt-level=4 -Z virtual-function-elimination -Z threads=4 -D warnings" ,
167
+ tag : " aarch64" ,
168
+ target : " aarch64-unknown-linux-gnu" ,
169
+ },
170
+ ]
171
+ python : [
172
+ { interpreter: 'python3.13', package: 'python3.13' },
173
+ ]
174
+ env :
175
+ PYTHON : " ${{ matrix.python.interpreter }}"
176
+ PYTHON_PACKAGE : " ${{ matrix.python.package }}"
177
+ TARGET : " ${{ matrix.arch.target }}"
178
+ CC : " ${{ matrix.arch.cc }}"
179
+ VENV : " .venv"
180
+ FEATURES : " ${{ matrix.arch.features }}"
181
+ CFLAGS : " ${{ matrix.arch.cflags }}"
182
+ LDFLAGS : " ${{ matrix.arch.ldflags }}"
183
+ RUSTFLAGS : " ${{ matrix.arch.rustflags }}"
184
+ CARGO_TARGET_DIR : " /tmp/orjson"
185
+ steps :
186
+
187
+ - name : cpuinfo
188
+ run : cat /proc/cpuinfo
189
+
190
+ - uses : actions/checkout@v4
191
+
192
+ - name : setup-qemu-container
193
+ uses : sandervocke/setup-qemu-container@v1
194
+ with :
195
+ container : registry.fedoraproject.org/fedora:42
196
+ arch : ${{ matrix.arch.tag }}
197
+ podman_args : " -v .:/orjson -v /tmp:/tmp --workdir /orjson"
198
+
199
+ - name : setup-shell-wrapper
200
+ uses : sandervocke/setup-shell-wrapper@v1
201
+
202
+ - name : Build and test
203
+ shell : wrap-shell {0}
204
+ env :
205
+ WRAP_SHELL : run-in-container.sh
206
+ run : |
207
+ set -eou pipefail
208
+
209
+ mkdir dist
210
+
211
+ export PATH="/root/.cargo/bin:/home/runner/work/orjson/orjson/.venv:/home/runner/.cargo/bin:$PATH"
212
+
213
+ ./script/install-fedora
214
+
215
+ source "${HOME}/.cargo/env"
216
+ source "${VENV}/bin/activate"
217
+
218
+ maturin build --release --strip \
219
+ --features="${FEATURES}" \
220
+ --compatibility=manylinux_2_17 \
221
+ --interpreter="${PYTHON}" \
222
+ --target="${TARGET}"
223
+
224
+ uv pip install ${CARGO_TARGET_DIR}/wheels/orjson*.whl
225
+
226
+ pytest -s -rxX -v -n 2 test
227
+
228
+ cp ${CARGO_TARGET_DIR}/wheels/orjson*.whl dist
229
+
230
+ - name : Store wheels
231
+ if : " startsWith(github.ref, 'refs/tags/')"
232
+ uses : actions/upload-artifact@v4
233
+ with :
234
+ name : orjson_manylinux_2_17_aarch64_${{ matrix.python.interpreter }}
235
+ path : dist
119
236
overwrite : true
120
237
retention-days : 1
121
238
@@ -416,12 +533,13 @@ jobs:
416
533
runs-on : ubuntu-24.04
417
534
if : " startsWith(github.ref, 'refs/tags/')"
418
535
needs : [
419
- sdist,
420
- manylinux_2_17_amd64,
421
- musllinux_1_2,
422
- manylinux_2_17_non_amd64,
423
536
macos_universal2_aarch64,
424
537
macos_universal2_amd64,
538
+ manylinux_2_17_aarch64,
539
+ manylinux_2_17_amd64,
540
+ manylinux_2_17_non_amd64,
541
+ musllinux_1_2,
542
+ sdist,
425
543
]
426
544
steps :
427
545
- uses : actions/download-artifact@v4
0 commit comments