Skip to content

Commit de88a7e

Browse files
author
Martijn Jacobs
committed
Create a single matrix for all builds
1 parent d20e55f commit de88a7e

1 file changed

Lines changed: 23 additions & 50 deletions

File tree

.github/workflows/wheels.yml

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -18,85 +18,51 @@ on:
1818
type: string
1919

2020
jobs:
21-
build-native:
21+
build:
2222
strategy:
2323
matrix:
2424
t:
2525
- os: ubuntu-24.04
26-
target: x86_64-unknown-linux-gnu
2726
arch: x64
27+
target: x86_64-unknown-linux-gnu
28+
test: native
29+
2830
- os: ubuntu-24.04-arm
29-
target: aarch64-unknown-linux-gnu
3031
arch: arm64
32+
target: aarch64-unknown-linux-gnu
33+
test: native
3134
# see https://github.com/astral-sh/ruff/issues/3791
3235
# and https://github.com/gnzlbg/jemallocator/issues/170#issuecomment-1503228963
3336
maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=16
3437

3538
# The macos-15-intel runner still supports x64, see https://github.com/actions/runner-images/issues/13045
3639
- os: macos-15-intel
37-
target: x86_64
3840
arch: x64
41+
target: x86_64
42+
test: native
3943
- os: macos-latest
40-
target: aarch64
4144
arch: arm64
45+
target: aarch64
46+
test: native
4247

4348
- os: windows-2022
44-
target: x86_64-pc-windows-msvc
4549
arch: x64
50+
target: x86_64-pc-windows-msvc
4651
- os: windows-2022
47-
target: i686-pc-windows-msvc
4852
arch: x86
49-
runs-on: ${{ matrix.t.os }}
50-
steps:
51-
- uses: actions/checkout@v4
52-
with:
53-
submodules: recursive
54-
persist-credentials: false
55-
- uses: actions/setup-python@v5
56-
with:
57-
python-version: ${{ inputs.python_version }}
58-
architecture: ${{ matrix.t.arch || env.DEFAULT_ARCH }}
59-
- uses: Swatinem/rust-cache@f0deed1e0edfc6a9be95417288c0e1099b1eeec3
60-
with:
61-
# The target is needed, because there were issues when reusing
62-
# caches, probably related to cross compiling.
63-
key: "swatinem-${{ matrix.t.target }}"
64-
- name: "Pre-Build"
65-
run: ./pre-maturin-build.sh
66-
- name: "Build Wheel"
67-
uses: PyO3/maturin-action@v1
68-
with:
69-
target: ${{ matrix.t.target }}
70-
working-directory: ${{ env.DEPLOY_DIR }}
71-
docker-options: ${{ matrix.t.maturin_docker_options }}
72-
manylinux: auto
73-
args: --release --locked --out dist --ignore-rust-version
74-
- name: "Test wheel"
75-
run: ./test-maturin-build.sh
76-
- name: "Upload wheel as a GitHub Artifact"
77-
uses: actions/upload-artifact@v4
78-
with:
79-
name: wheels-${{ matrix.t.os }}-${{ matrix.t.target }}
80-
path: "${{ env.DEPLOY_DIR }}/dist"
53+
target: i686-pc-windows-msvc
54+
test: native
8155

82-
build-cross:
83-
strategy:
84-
matrix:
85-
t:
86-
# manylinux armv7
56+
# manylinux armv7 / x86 (i686)
8757
- os: ubuntu-24.04
8858
arch: armv7
8959
target: armv7-unknown-linux-gnueabihf
90-
manylinux: auto
9160
test: run-on-arch
9261
distro: ubuntu24.04
9362
install_cmd: apt-get update && apt-get install -y python3 python3-pip python3-venv
94-
95-
# manylinux x86 (i686)
9663
- os: ubuntu-24.04
9764
arch: x86
9865
target: i686-unknown-linux-gnu
99-
manylinux: auto
10066
test: container
10167
image: i386/python:${{ inputs.python_version }}-slim-trixie
10268
install_cmd: apt-get install -y bash
@@ -130,7 +96,6 @@ jobs:
13096
test: container
13197
image: i386/python:${{ inputs.python_version }}-alpine
13298
install_cmd: apk add bash
133-
13499
runs-on: ${{ matrix.t.os }}
135100
steps:
136101
- uses: actions/checkout@v4
@@ -150,8 +115,16 @@ jobs:
150115
target: ${{ matrix.t.target }}
151116
working-directory: ${{ env.DEPLOY_DIR }}
152117
docker-options: ${{ matrix.t.maturin_docker_options }}
153-
manylinux: ${{ matrix.t.manylinux }}
118+
manylinux: ${{ matrix.t.manylinux || 'auto' }}
154119
args: --release --locked --out dist --ignore-rust-version
120+
- uses: actions/setup-python@v5
121+
if: matrix.t.test == 'native'
122+
with:
123+
python-version: ${{ inputs.python_version }}
124+
architecture: ${{ matrix.t.arch || env.DEFAULT_ARCH }}
125+
- name: "Test wheel (native)"
126+
if: matrix.t.test == 'native'
127+
run: ./test-maturin-build.sh
155128
- name: "Test wheel (run-on-arch)"
156129
if: matrix.t.test == 'run-on-arch'
157130
uses: uraimo/run-on-arch-action@v3

0 commit comments

Comments
 (0)