@@ -3,11 +3,11 @@ name: Build
33on :
44 workflow_dispatch :
55 push :
6- branches : [ master ]
6+ branches : [master]
77 tags :
88 - v*
99 pull_request :
10- branches : [ master ]
10+ branches : [master]
1111
1212env :
1313 CARGO_TERM_COLOR : always
@@ -30,81 +30,100 @@ jobs:
3030 matrix :
3131 os : [ubuntu-latest, windows-latest, macos-latest]
3232 steps :
33- - uses : actions/checkout@v3
34- - name : Install Dependencies
35- run : sudo apt install libunwind-dev
36- if : runner.os == 'Linux'
37- - name : Build
38- run : cargo build --release --verbose --examples
39- - uses : actions/setup-python@v4
40- with :
41- python-version : 3.9
42- - name : Test
43- id : test
44- continue-on-error : true
45- run : cargo test --release
46- - name : Test (retry#1)
47- id : test1
48- run : cargo test --release
49- if : steps.test.outcome=='failure'
50- continue-on-error : true
51- - name : Test (retry#2)
52- run : cargo test --release
53- if : steps.test1.outcome=='failure'
54- - name : Build Wheel
55- run : |
56- pip install --upgrade maturin
57- maturin build --release -o dist
58- if : runner.os != 'Linux'
59- - name : Build Wheel - universal2
60- env :
61- DEVELOPER_DIR : /Applications/Xcode.app/Contents/Developer
62- SDKROOT : /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
63- MACOSX_DEPLOYMENT_TARGET : 10.9
64- run : |
65- rustup target add aarch64-apple-darwin
66- rustup target add x86_64-apple-darwin
67- pip install --upgrade maturin
68- maturin build --release -o dist --target universal2-apple-darwin
69- if : matrix.os == 'macos-latest'
70- - name : Rename Wheels
71- run : |
72- python3 -c "import shutil; import glob; wheels = glob.glob('dist/*.whl'); [shutil.move(wheel, wheel.replace('py3', 'py2.py3')) for wheel in wheels if 'py2' not in wheel]"
73- if : runner.os != 'Linux'
74- - name : Upload wheels
75- uses : actions/upload-artifact@v3
76- with :
77- name : wheels
78- path : dist
79- if : runner.os != 'Linux'
33+ - uses : actions/checkout@v3
34+ - uses : Swatinem/rust-cache@v2
35+ - name : Install Dependencies
36+ run : sudo apt install libunwind-dev
37+ if : runner.os == 'Linux'
38+ - uses : actions/setup-python@v4
39+ with :
40+ python-version : 3.9
41+ - name : Build
42+ run : cargo build --release --verbose --examples
43+ - uses : actions/setup-python@v4
44+ with :
45+ python-version : 3.9
46+ - name : Test
47+ id : test
48+ continue-on-error : true
49+ run : cargo test --release
50+ - name : Test (retry#1)
51+ id : test1
52+ run : cargo test --release
53+ if : steps.test.outcome=='failure'
54+ continue-on-error : true
55+ - name : Test (retry#2)
56+ run : cargo test --release
57+ if : steps.test1.outcome=='failure'
58+ - name : Build Wheel
59+ run : |
60+ pip install --upgrade maturin
61+ maturin build --release -o dist --all-features
62+ if : runner.os == 'Windows'
63+ - name : Build Wheel - universal2
64+ env :
65+ DEVELOPER_DIR : /Applications/Xcode.app/Contents/Developer
66+ SDKROOT : /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
67+ MACOSX_DEPLOYMENT_TARGET : 10.9
68+ run : |
69+ rustup target add aarch64-apple-darwin
70+ rustup target add x86_64-apple-darwin
71+ pip install --upgrade maturin
72+ maturin build --release -o dist
73+ maturin build --release -o dist --target universal2-apple-darwin
74+ if : matrix.os == 'macos-latest'
75+ - name : Rename Wheels
76+ run : |
77+ python3 -c "import shutil; import glob; wheels = glob.glob('dist/*.whl'); [shutil.move(wheel, wheel.replace('py3', 'py2.py3')) for wheel in wheels if 'py2' not in wheel]"
78+ if : runner.os != 'Linux'
79+ - name : Upload wheels
80+ uses : actions/upload-artifact@v3
81+ with :
82+ name : wheels
83+ path : dist
84+ if : runner.os != 'Linux'
8085
8186 build-linux-cross :
8287 runs-on : ubuntu-latest
8388 needs : [lint]
8489 strategy :
8590 fail-fast : false
8691 matrix :
87- target : [i686-musl, armv7-musleabihf, aarch64-musl, x86_64-musl]
92+ target :
93+ [
94+ i686-unknown-linux-musl,
95+ armv7-unknown-linux-musleabihf,
96+ aarch64-unknown-linux-musl,
97+ x86_64-unknown-linux-musl,
98+ ]
8899 container :
89- image : docker:/ /benfred/rust-musl-cross:${{ matrix.target }}
100+ image : ghcr.io /benfred/rust-musl-cross:${{ matrix.target }}
90101 env :
91102 RUSTUP_HOME : /root/.rustup
92103 CARGO_HOME : /root/.cargo
93104 steps :
94- - uses : actions/checkout@v3
95- - name : Build
96- run : |
97- python3 -m pip install --upgrade maturin
98- maturin build --release -o dist --target $RUST_MUSL_CROSS_TARGET
99- maturin sdist -o dist
100- - name : Rename Wheels
101- run : |
102- python3 -c "import shutil; import glob; wheels = glob.glob('dist/*.whl'); [shutil.move(wheel, wheel.replace('py3', 'py2.py3')) for wheel in wheels if 'py2' not in wheel]"
103- - name : Upload wheels
104- uses : actions/upload-artifact@v3
105- with :
106- name : wheels
107- path : dist
105+ - uses : actions/checkout@v3
106+ - uses : Swatinem/rust-cache@v2
107+ - name : Build
108+ run : |
109+ python3 -m pip install --upgrade maturin
110+ maturin build --release -o dist --target ${{ matrix.target }} --features unwind
111+ maturin sdist -o dist
112+ if : matrix.target == 'x86_64-unknown-linux-musl'
113+ - name : Build
114+ run : |
115+ python3 -m pip install --upgrade maturin
116+ maturin build --release -o dist --target ${{ matrix.target }}
117+ maturin sdist -o dist
118+ if : matrix.target != 'x86_64-unknown-linux-musl'
119+ - name : Rename Wheels
120+ run : |
121+ python3 -c "import shutil; import glob; wheels = glob.glob('dist/*.whl'); [shutil.move(wheel, wheel.replace('py3', 'py2.py3')) for wheel in wheels if 'py2' not in wheel]"
122+ - name : Upload wheels
123+ uses : actions/upload-artifact@v3
124+ with :
125+ name : wheels
126+ path : dist
108127
109128 build-freebsd :
110129 runs-on : ubuntu-22.04
@@ -169,33 +188,54 @@ jobs:
169188 runs-on : ${{ matrix.os }}
170189 strategy :
171190 fail-fast : false
191+ # automatically generated by ci/update_python_test_versions.py
172192 matrix :
173- python-version : [3.6.7, 3.6.15, 3.7.1, 3.7.17, 3.8.0, 3.8.18, 3.9.0, 3.9.20, 3.10.0, 3.10.1, 3.10.2, 3.10.3, 3.10.4, 3.10.5, 3.10.6, 3.10.7, 3.10.8, 3.10.9, 3.10.10, 3.10.11, 3.10.12, 3.10.13, 3.10.14, 3.10.15, 3.11.0, 3.11.1, 3.11.2, 3.11.3, 3.11.4, 3.11.5, 3.11.6, 3.11.7, 3.11.8, 3.11.9, 3.11.10]
193+ python-version :
194+ [
195+ 3.6.7,
196+ 3.6.15,
197+ 3.7.1,
198+ 3.7.17,
199+ 3.8.0,
200+ 3.8.18,
201+ 3.9.0,
202+ 3.9.20,
203+ 3.10.0,
204+ 3.10.15,
205+ 3.11.0,
206+ 3.11.10,
207+ 3.12.0,
208+ 3.12.1,
209+ 3.12.2,
210+ 3.12.3,
211+ 3.12.4,
212+ 3.12.5,
213+ 3.12.6,
214+ 3.12.7,
215+ 3.13.0,
216+ ]
217+ # TODO: also test windows
174218 os : [ubuntu-20.04, macos-13, windows-latest]
175219 # some versions of python can't be tested on GHA with osx because of SIP:
176220 exclude :
177221 - os : macos-13
178- python-version : 3.11.0
179- - os : macos-13
180- python-version : 3.11.1
181- - os : macos-13
182- python-version : 3.11.2
222+ python-version : 3.11.10
183223 - os : macos-13
184- python-version : 3.11.3
224+ python-version : 3.12.0
185225 - os : macos-13
186- python-version : 3.11.4
226+ python-version : 3.12.1
187227 - os : macos-13
188- python-version : 3.11.5
228+ python-version : 3.12.2
189229 - os : macos-13
190- python-version : 3.11.6
230+ python-version : 3.12.3
191231 - os : macos-13
192- python-version : 3.11.7
232+ python-version : 3.12.4
193233 - os : macos-13
194- python-version : 3.11.8
234+ python-version : 3.12.5
195235 - os : macos-13
196- python-version : 3.11.9
236+ python-version : 3.12.6
197237 - os : macos-13
198- python-version : 3.11.10
238+ python-version : 3.12.7
199239
200240 steps :
201241 - uses : actions/checkout@v2
0 commit comments