1- # This file is autogenerated by maturin v1.1.0
1+ # This file is autogenerated by maturin v1.8.2
22# To update, run
33#
4- # maturin generate-ci --pytest github
4+ # maturin generate-ci --pytest --platform all --zig github
55#
66name : CI
77
1111 - main
1212 - master
1313 tags :
14- - ' * '
14+ - " * "
1515 pull_request :
1616 workflow_dispatch :
1717
@@ -20,74 +20,150 @@ permissions:
2020
2121jobs :
2222 linux :
23- runs-on : ubuntu-latest
23+ runs-on : ${{ matrix.platform.runner }}
2424 strategy :
2525 fail-fast : false
2626 matrix :
27- # If you update the targets here, be sure to also update the
28- # download-artifact step in the release job!
29- target : [ x86_64, aarch64]
30- # pytensor is currently giving me issues on the other targets...
31- # target: [x86_64, aarch64, s390x, ppc64le]
27+ platform :
28+ - runner : ubuntu-22.04
29+ target : x86_64
30+ - runner : ubuntu-22.04
31+ target : aarch64
3232 steps :
3333 - uses : actions/checkout@v4
3434 - uses : actions/setup-python@v5
3535 with :
36- python-version : ' 3.10'
36+ python-version : " 3.12"
37+ - name : Install uv
38+ uses : astral-sh/setup-uv@v5
3739 - name : Build wheels
3840 uses : PyO3/maturin-action@v1
3941 with :
40- target : ${{ matrix.target }}
41- args : --release --out dist --find-interpreter
42- manylinux : 2_28
42+ target : ${{ matrix.platform.target }}
43+ args : --release --out dist --find-interpreter --zig
44+ sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
45+ manylinux : auto
4346 before-script-linux : |
44- dnf install -y clang-libs clang || apt install llvm-dev libclang-dev clang
45-
47+ dnf install -y clang-libs clang || sudo apt install llvm-dev libclang-dev clang
4648 - name : Upload wheels
4749 uses : actions/upload-artifact@v4
4850 with :
49- name : linux-${{ matrix.target }}-wheels
51+ name : wheels- linux-${{ matrix.platform. target }}
5052 path : dist
5153 - name : pytest
52- if : ${{ startsWith(matrix.target, 'x86_64') }}
54+ if : ${{ startsWith(matrix.platform. target, 'x86_64') }}
5355 shell : bash
5456 run : |
5557 set -e
56- pip install --find-links dist --force-reinstall 'nutpie[all]'
57- pip install --find-links dist --force-reinstall --no-deps --no-index 'nutpie[all]'
58- pip install pytest
58+ python3 -m venv .venv
59+ source .venv/bin/activate
60+ uv pip install 'nutpie[all]' --find-links dist --force-reinstall
61+ uv pip install pytest
5962 pytest
6063 - name : pytest
61- if : ${{ !startsWith(matrix.target, 'x86') }}
62- uses : uraimo/run-on-arch-action@v2.8.1
64+ if : ${{ !startsWith(matrix.platform. target, 'x86') && matrix.platform.target != 'ppc64' }}
65+ uses : uraimo/run-on-arch-action@v2
6366 with :
64- arch : ${{ matrix.target }}
67+ arch : ${{ matrix.platform. target }}
6568 distro : ubuntu22.04
6669 githubToken : ${{ github.token }}
6770 install : |
6871 apt-get update
69- apt-get install -y --no-install-recommends python3 python3-pip build-essential libhdf5-dev python3-dev pkg-config curl
70- pip3 install -U pip pytest
72+ apt-get install -y --no-install-recommends python3 python3-pip curl make clang build-essential python3-dev
73+ curl -LsSf https://astral.sh/uv/install.sh | sh
74+ source $HOME/.local/bin/env
7175 run : |
7276 set -e
73- pip3 install --find-links dist --force-reinstall 'nutpie[all]'
74- pip3 install 'nutpie[all]' --find-links dist --no-deps --no-index --force-reinstall
77+ source $HOME/.local/bin/env
78+ uv pip install --system -U pip pytest
79+ uv pip install --system 'nutpie[all]' --find-links dist --force-reinstall
7580 pytest
7681
82+ # pyarrow doesn't currently seem to work on musllinux
83+ # musllinux:
84+ # runs-on: ${{ matrix.platform.runner }}
85+ # strategy:
86+ # fail-fast: false
87+ # matrix:
88+ # platform:
89+ # - runner: ubuntu-22.04
90+ # target: x86_64
91+ # - runner: ubuntu-22.04
92+ # target: aarch64
93+ # steps:
94+ # - uses: actions/checkout@v4
95+ # - uses: actions/setup-python@v5
96+ # with:
97+ # python-version: "3.12"
98+ # - name: Install uv
99+ # uses: astral-sh/setup-uv@v5
100+ # - name: Build wheels
101+ # uses: PyO3/maturin-action@v1
102+ # with:
103+ # target: ${{ matrix.platform.target }}
104+ # args: --release --out dist --find-interpreter
105+ # sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
106+ # manylinux: musllinux_1_2
107+ # before-script-linux: |
108+ # dnf install -y clang-libs clang || apt install llvm-dev libclang-dev clang
109+ # - name: Upload wheels
110+ # uses: actions/upload-artifact@v4
111+ # with:
112+ # name: wheels-musllinux-${{ matrix.platform.target }}
113+ # path: dist
114+ # - name: pytest
115+ # if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
116+ # uses: addnab/docker-run-action@v3
117+ # with:
118+ # image: alpine:latest
119+ # options: -v ${{ github.workspace }}:/io -w /io
120+ # run: |
121+ # set -e
122+ # apk add py3-pip py3-virtualenv curl make clang
123+ # curl -LsSf https://astral.sh/uv/install.sh | sh
124+ # source $HOME/.local/bin/env
125+ # python3 -m virtualenv .venv
126+ # source .venv/bin/activate
127+ # # No numba packages for alpine
128+ # uv pip install 'nutpie[stan]' --find-links dist --force-reinstall
129+ # uv pip install pytest
130+ # pytest
131+ # - name: pytest
132+ # if: ${{ !startsWith(matrix.platform.target, 'x86') }}
133+ # uses: uraimo/run-on-arch-action@v2
134+ # with:
135+ # arch: ${{ matrix.platform.target }}
136+ # distro: alpine_latest
137+ # githubToken: ${{ github.token }}
138+ # install: |
139+ # apk add py3-virtualenv curl make clang
140+ # curl -LsSf https://astral.sh/uv/install.sh | sh
141+ # source $HOME/.local/bin/env
142+ # run: |
143+ # set -e
144+ # python3 -m virtualenv .venv
145+ # source $HOME/.local/bin/env
146+ # source .venv/bin/activate
147+ # uv pip install pytest
148+ # # No numba packages for alpine
149+ # uv pip install 'nutpie[stan]' --find-links dist --force-reinstall
150+ # pytest
151+
77152 windows :
78- runs-on : windows-latest
153+ runs-on : ${{ matrix.platform.runner }}
79154 strategy :
80- fail-fast : false
81155 matrix :
82- # If you update the targets here, be sure to also update the
83- # download-artifact step in the release job!
84- target : [ x64]
156+ platform :
157+ - runner : windows-latest
158+ target : x64
85159 steps :
86160 - uses : actions/checkout@v4
87161 - uses : actions/setup-python@v5
88162 with :
89- python-version : ' 3.10'
90- architecture : ${{ matrix.target }}
163+ python-version : " 3.12"
164+ architecture : ${{ matrix.platform.target }}
165+ - name : Install uv
166+ uses : astral-sh/setup-uv@v5
91167 - name : Install LLVM and Clang
92168 uses : KyleMayes/install-llvm-action@v2
93169 with :
@@ -102,59 +178,63 @@ jobs:
102178 env :
103179 LIBCLANG_PATH : ${{ runner.temp }}/llvm/lib
104180 with :
105- target : ${{ matrix.target }}
181+ target : ${{ matrix.platform. target }}
106182 args : --release --out dist --find-interpreter
107- sccache : ' true '
183+ sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
108184 - name : Upload wheels
109185 uses : actions/upload-artifact@v4
110186 with :
111- name : windows-${{ matrix.target }}-wheels
187+ name : wheels- windows-${{ matrix.platform. target }}
112188 path : dist
113189 - name : pytest
114- if : ${{ !startsWith(matrix.target, 'aarch64') }}
190+ if : ${{ !startsWith(matrix.platform. target, 'aarch64') }}
115191 shell : bash
116192 run : |
117193 set -e
118- pip install "nutpie[all]" --find-links dist --force-reinstall
119- pip install --find-links dist --force-reinstall --no-deps --no-index 'nutpie[all]'
120- pip install pytest
194+ python3 -m venv .venv
195+ source .venv/Scripts/activate
196+ uv pip install "nutpie[all]" --find-links dist --force-reinstall
197+ uv pip install pytest
121198 pytest
122199
123200 macos :
124- runs-on : macos-latest
201+ runs-on : ${{ matrix.platform.runner }}
125202 strategy :
126203 fail-fast : false
127204 matrix :
128- # If you update the targets here, be sure to also update the
129- # download-artifact step in the release job!
130- target : [x86_64, aarch64]
205+ platform :
206+ - runner : macos-13
207+ target : x86_64
208+ - runner : macos-14
209+ target : aarch64
131210 steps :
132211 - uses : actions/checkout@v4
133212 - uses : actions/setup-python@v5
134213 with :
135- python-version : ' 3.10'
214+ python-version : " 3.12"
215+ - name : Install uv
216+ uses : astral-sh/setup-uv@v5
136217 - uses : maxim-lobanov/setup-xcode@v1
137218 with :
138219 xcode-version : latest-stable
139220 - name : Build wheels
140221 uses : PyO3/maturin-action@v1
141222 with :
142- target : ${{ matrix.target }}
223+ target : ${{ matrix.platform. target }}
143224 args : --release --out dist --find-interpreter
144- sccache : ' true '
225+ sccache : ${{ !startsWith(github.ref, 'refs/tags/') }}
145226 - name : Upload wheels
146227 uses : actions/upload-artifact@v4
147228 with :
148- name : macos-${{ matrix.target }}-wheels
229+ name : wheels- macos-${{ matrix.platform. target }}
149230 path : dist
150231 - name : pytest
151- if : ${{ startsWith(matrix.target, 'aarch64') }}
152- shell : bash
153232 run : |
154233 set -e
155- pip install 'nutpie[all]' --find-links dist --force-reinstall
156- pip install --find-links dist --force-reinstall --no-deps --no-index 'nutpie[all]'
157- pip install pytest
234+ python3 -m venv .venv
235+ source .venv/bin/activate
236+ uv pip install 'nutpie[all]' --find-links dist --force-reinstall
237+ uv pip install pytest
158238 pytest
159239
160240 sdist :
@@ -169,45 +249,38 @@ jobs:
169249 - name : Upload sdist
170250 uses : actions/upload-artifact@v4
171251 with :
172- name : sdist
252+ name : wheels- sdist
173253 path : dist
174254
175255 release :
176256 name : Release
177257 runs-on : ubuntu-latest
178- if : " startsWith(github.ref, 'refs/tags/')"
258+ if : ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
179259 needs : [linux, windows, macos, sdist]
260+ permissions :
261+ # Use to sign the release artifacts
262+ id-token : write
263+ # Used to upload release artifacts
264+ contents : write
265+ # Used to generate artifact attestation
266+ attestations : write
180267 steps :
181- # Combine all the wheels and sdists into a single directory
182- - name : Download artifacts
183- uses : actions/download-artifact@v4
184- with :
185- name : linux-x86_64-wheels
186- path : dist
187- - uses : actions/download-artifact@v4
188- with :
189- name : linux-aarch64-wheels
190- path : dist
191268 - uses : actions/download-artifact@v4
269+ - name : Generate artifact attestation
270+ uses : actions/attest-build-provenance@v1
192271 with :
193- name : windows-x64-wheels
194- path : dist
195- - uses : actions/download-artifact@v4
196- with :
197- name : macos-x86_64-wheels
198- path : dist
199- - uses : actions/download-artifact@v4
200- with :
201- name : macos-aarch64-wheels
202- path : dist
203- - uses : actions/download-artifact@v4
204- with :
205- name : sdist
206- path : dist
272+ subject-path : " wheels-*/*"
207273 - name : Publish to PyPI
274+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
208275 uses : PyO3/maturin-action@v1
209276 env :
210277 MATURIN_PYPI_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
211278 with :
212279 command : upload
213- args : --skip-existing dist/*
280+ args : --non-interactive --skip-existing wheels-*/*
281+ - name : Upload to GitHub Release
282+ uses : softprops/action-gh-release@v1
283+ with :
284+ files : |
285+ wasm-wheels/*.whl
286+ prerelease : ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
0 commit comments