1- # This file is autogenerated by maturin v1.7.0
1+ # This file is autogenerated by maturin v1.8.3
22# To update, run
33#
4- # maturin generate-ci github
4+ # maturin generate-ci --pytest github
55#
66name : CI
77
@@ -24,17 +24,17 @@ jobs:
2424 strategy :
2525 matrix :
2626 platform :
27- - runner : ubuntu-latest
27+ - runner : ubuntu-22.04
2828 target : x86_64
29- - runner : ubuntu-latest
29+ - runner : ubuntu-22.04
3030 target : x86
31- - runner : ubuntu-latest
31+ - runner : ubuntu-22.04
3232 target : aarch64
33- - runner : ubuntu-latest
33+ - runner : ubuntu-22.04
3434 target : armv7
35- - runner : ubuntu-latest
35+ - runner : ubuntu-22.04
3636 target : s390x
37- - runner : ubuntu-latest
37+ - runner : ubuntu-22.04
3838 target : ppc64le
3939 steps :
4040 - uses : actions/checkout@v4
@@ -46,26 +46,51 @@ jobs:
4646 with :
4747 target : ${{ matrix.platform.target }}
4848 args : --release --out dist --find-interpreter
49- sccache : ' true '
49+ sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
5050 manylinux : auto
5151 - name : Upload wheels
5252 uses : actions/upload-artifact@v4
5353 with :
5454 name : wheels-linux-${{ matrix.platform.target }}
5555 path : dist
56+ - name : pytest
57+ if : ${{ startsWith(matrix.platform.target, 'x86_64') }}
58+ shell : bash
59+ run : |
60+ set -e
61+ python3 -m venv .venv
62+ source .venv/bin/activate
63+ pip install urlpattern --find-links dist --force-reinstall
64+ pip install pytest
65+ pytest
66+ - name : pytest
67+ if : ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
68+ uses : uraimo/run-on-arch-action@v2
69+ with :
70+ arch : ${{ matrix.platform.target }}
71+ distro : ubuntu22.04
72+ githubToken : ${{ github.token }}
73+ install : |
74+ apt-get update
75+ apt-get install -y --no-install-recommends python3 python3-pip
76+ pip3 install -U pip pytest
77+ run : |
78+ set -e
79+ pip3 install urlpattern --find-links dist --force-reinstall
80+ pytest
5681
5782 musllinux :
5883 runs-on : ${{ matrix.platform.runner }}
5984 strategy :
6085 matrix :
6186 platform :
62- - runner : ubuntu-latest
87+ - runner : ubuntu-22.04
6388 target : x86_64
64- - runner : ubuntu-latest
89+ - runner : ubuntu-22.04
6590 target : x86
66- - runner : ubuntu-latest
91+ - runner : ubuntu-22.04
6792 target : aarch64
68- - runner : ubuntu-latest
93+ - runner : ubuntu-22.04
6994 target : armv7
7095 steps :
7196 - uses : actions/checkout@v4
@@ -77,13 +102,43 @@ jobs:
77102 with :
78103 target : ${{ matrix.platform.target }}
79104 args : --release --out dist --find-interpreter
80- sccache : ' true '
105+ sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
81106 manylinux : musllinux_1_2
82107 - name : Upload wheels
83108 uses : actions/upload-artifact@v4
84109 with :
85110 name : wheels-musllinux-${{ matrix.platform.target }}
86111 path : dist
112+ - name : pytest
113+ if : ${{ startsWith(matrix.platform.target, 'x86_64') }}
114+ uses : addnab/docker-run-action@v3
115+ with :
116+ image : alpine:latest
117+ options : -v ${{ github.workspace }}:/io -w /io
118+ run : |
119+ set -e
120+ apk add py3-pip py3-virtualenv
121+ python3 -m virtualenv .venv
122+ source .venv/bin/activate
123+ pip install urlpattern --no-index --find-links dist --force-reinstall
124+ pip install pytest
125+ pytest
126+ - name : pytest
127+ if : ${{ !startsWith(matrix.platform.target, 'x86') }}
128+ uses : uraimo/run-on-arch-action@v2
129+ with :
130+ arch : ${{ matrix.platform.target }}
131+ distro : alpine_latest
132+ githubToken : ${{ github.token }}
133+ install : |
134+ apk add py3-virtualenv
135+ run : |
136+ set -e
137+ python3 -m virtualenv .venv
138+ source .venv/bin/activate
139+ pip install pytest
140+ pip install urlpattern --find-links dist --force-reinstall
141+ pytest
87142
88143 windows :
89144 runs-on : ${{ matrix.platform.runner }}
@@ -105,19 +160,29 @@ jobs:
105160 with :
106161 target : ${{ matrix.platform.target }}
107162 args : --release --out dist --find-interpreter
108- sccache : ' true '
163+ sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
109164 - name : Upload wheels
110165 uses : actions/upload-artifact@v4
111166 with :
112167 name : wheels-windows-${{ matrix.platform.target }}
113168 path : dist
169+ - name : pytest
170+ if : ${{ !startsWith(matrix.platform.target, 'aarch64') }}
171+ shell : bash
172+ run : |
173+ set -e
174+ python3 -m venv .venv
175+ source .venv/Scripts/activate
176+ pip install urlpattern --find-links dist --force-reinstall
177+ pip install pytest
178+ pytest
114179
115180 macos :
116181 runs-on : ${{ matrix.platform.runner }}
117182 strategy :
118183 matrix :
119184 platform :
120- - runner : macos-12
185+ - runner : macos-13
121186 target : x86_64
122187 - runner : macos-14
123188 target : aarch64
@@ -131,12 +196,20 @@ jobs:
131196 with :
132197 target : ${{ matrix.platform.target }}
133198 args : --release --out dist --find-interpreter
134- sccache : ' true '
199+ sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
135200 - name : Upload wheels
136201 uses : actions/upload-artifact@v4
137202 with :
138203 name : wheels-macos-${{ matrix.platform.target }}
139204 path : dist
205+ - name : pytest
206+ run : |
207+ set -e
208+ python3 -m venv .venv
209+ source .venv/bin/activate
210+ pip install urlpattern --find-links dist --force-reinstall
211+ pip install pytest
212+ pytest
140213
141214 sdist :
142215 runs-on : ubuntu-latest
@@ -156,15 +229,26 @@ jobs:
156229 release :
157230 name : Release
158231 runs-on : ubuntu-latest
159- if : " startsWith(github.ref, 'refs/tags/')"
232+ if : ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
160233 needs : [linux, musllinux, windows, macos, sdist]
161- environment : release
162234 permissions :
235+ # Use to sign the release artifacts
163236 id-token : write
237+ # Used to upload release artifacts
238+ contents : write
239+ # Used to generate artifact attestation
240+ attestations : write
164241 steps :
165242 - uses : actions/download-artifact@v4
243+ - name : Generate artifact attestation
244+ uses : actions/attest-build-provenance@v2
245+ with :
246+ subject-path : ' wheels-*/*'
166247 - name : Publish to PyPI
248+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
167249 uses : PyO3/maturin-action@v1
250+ env :
251+ MATURIN_PYPI_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
168252 with :
169253 command : upload
170254 args : --non-interactive --skip-existing wheels-*/*
0 commit comments