-
-
Notifications
You must be signed in to change notification settings - Fork 11
157 lines (152 loc) · 5.74 KB
/
Test.yml
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
on:
workflow_dispatch:
name: Test
jobs:
test-maturin:
name: Test maturin (${{ matrix.arch }}, ${{ matrix.python.version }}, ${{ matrix.manylinux }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.7', abi: 'cp37-cp37m' },
{ version: '3.8', abi: 'cp38-cp38' },
{ version: '3.9', abi: 'cp39-cp39' },
{ version: '3.10', abi: 'cp310-cp310' },
]
arch: [aarch64, armv7, s390x, ppc64le]
manylinux: [manylinux2014, manylinux_2_28]
steps:
- uses: actions/checkout@v4
- name: Build Wheel
uses: messense/maturin-action@v1
env:
PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}/lib
with:
target: ${{ matrix.arch }}
manylinux: ${{ matrix.manylinux }}
args: -i python3.9 --release --out dist -m pyo3-test/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-maturin
path: dist
test-maturin-wheels:
name: Test maturin built wheels
runs-on: ubuntu-latest
needs: [ test-maturin ]
strategy:
matrix:
arch: ['aarch64', 'armv7', 's390x', 'ppc64le']
steps:
- uses: actions/download-artifact@v4
with:
name: wheels-maturin
- uses: uraimo/[email protected]
name: Install built wheel
with:
arch: ${{ matrix.arch }}
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/io"
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-distutils software-properties-common curl
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y python3.7 python3.7-distutils python3.9 python3.9-distutils python3.10 python3.10-distutils
for VER in 3.7 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; done
run: |
for VER in 3.7 3.8 3.9 3.10; do
PYTHON="python$VER"
$PYTHON -m pip install pyo3-test --no-index --find-links /io --force-reinstall
$PYTHON -c 'import pyo3_test; assert pyo3_test.fourtytwo == 42'
done
test-setuptools-rust:
name: Test setuptools-rust (${{ matrix.platform.arch }}, ${{ matrix.python.version }}, ${{ matrix.manylinux }})
runs-on: ubuntu-latest
# needs: [ build ]
strategy:
matrix:
python: [
{ version: '3.7', name: 'cp37-cp37m' },
{ version: '3.8', name: 'cp38-cp38' },
{ version: '3.9', name: 'cp39-cp39' },
{ version: '3.10', name: 'cp310-cp310' },
]
platform: [
{ target: "aarch64-unknown-linux-gnu", arch: "aarch64" },
{ target: "armv7-unknown-linux-gnueabihf", arch: "armv7" },
{ target: "s390x-unknown-linux-gnu", arch: "s390x" },
{ target: "powerpc64le-unknown-linux-gnu", arch: "ppc64le" },
]
manylinux: [manylinux2014, manylinux_2_28]
container:
image: docker://messense/${{ matrix.manylinux }}-cross:${{ matrix.platform.arch }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.platform.target }}
- name: Build Wheels
env:
PLAT_NAME: manylinux2014_${{ matrix.platform.arch }}
shell: bash -e {0}
run: |
PYTHON=python${{ matrix.python.version }}
$PYTHON -m pip install 'crossenv>=1.1.2'
cd pyo3-test
$PYTHON -m crossenv /opt/python/${{ matrix.python.name }}/bin/python3 --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= venv
. venv/bin/activate
build-pip install wheel "setuptools>=62.4"
pip install -U pip wheel setuptools-rust
export PYO3_CROSS_LIB_DIR="$PWD/venv/lib"
python setup.py bdist_wheel --dist-dir ../dist/
ls -lrth ../dist/
- name: Audit Wheel Symbols
shell: bash -e {0}
run: |
for whl in dist/pyo3_test*.whl; do
auditwheel-symbols "$whl"
done
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-setuptools-rust
path: dist
test-setuptools-rust-wheels:
name: Test setuptools-rust built wheels
runs-on: ubuntu-latest
needs: [ test-setuptools-rust ]
strategy:
matrix:
arch: ['aarch64', 'armv7', 's390x', 'ppc64le']
steps:
- uses: actions/download-artifact@v4
with:
name: wheels-setuptools-rust
- uses: uraimo/[email protected]
name: Install built wheel
with:
arch: ${{ matrix.arch }}
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/io"
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-distutils software-properties-common curl
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y python3.7 python3.7-distutils python3.9 python3.9-distutils python3.10 python3.10-distutils
for VER in 3.7 3.8 3.9 3.10; do curl -sS https://bootstrap.pypa.io/get-pip.py | "python$VER"; done
run: |
for VER in 3.7 3.8 3.9 3.10; do
PYTHON="python$VER"
$PYTHON -m pip install pyo3-test --no-index --find-links /io --force-reinstall
$PYTHON -c 'import pyo3_test; assert pyo3_test.fourtytwo == 42'
done