@@ -129,7 +129,7 @@ jobs:
129129 os : [macos-latest, ubuntu-latest, windows-2025]
130130 fail-fast : false
131131 steps :
132- - uses : actions/checkout@v6.0.2
132+ - uses : actions/checkout@v6
133133 - uses : dtolnay/rust-toolchain@stable
134134 with :
135135 components : clippy
@@ -143,10 +143,6 @@ jobs:
143143
144144 - name : run rust tests
145145 run : cargo test --workspace ${{ env.WORKSPACE_EXCLUDES }} --verbose --features threading ${{ env.CARGO_ARGS }}
146- if : runner.os != 'macOS'
147- - name : run rust tests
148- run : cargo test --workspace ${{ env.WORKSPACE_EXCLUDES }} --exclude rustpython-jit --verbose --features threading ${{ env.CARGO_ARGS }}
149- if : runner.os == 'macOS'
150146
151147 - name : check compilation without threading
152148 run : cargo check ${{ env.CARGO_ARGS }}
@@ -188,87 +184,58 @@ jobs:
188184 PYTHONPATH : scripts
189185 if : runner.os == 'Linux'
190186
191- - name : prepare Intel MacOS build
192- uses : dtolnay/rust-toolchain@stable
193- with :
194- target : x86_64-apple-darwin
195- if : runner.os == 'macOS'
196- - name : Check compilation for Intel MacOS
197- run : cargo check --target x86_64-apple-darwin
198- if : runner.os == 'macOS'
199- - name : prepare iOS build
200- uses : dtolnay/rust-toolchain@stable
201- with :
202- target : aarch64-apple-ios
203- if : runner.os == 'macOS'
204- - name : Check compilation for iOS
205- run : cargo check --target aarch64-apple-ios ${{ env.CARGO_ARGS_NO_SSL }}
206- if : runner.os == 'macOS'
207-
208- exotic_targets :
187+ cargo_check :
209188 if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
210189 name : Ensure compilation on various targets
211- runs-on : ubuntu-latest
212- timeout-minutes : 30
190+ runs-on : ${{ matrix.os }}
191+ strategy :
192+ matrix :
193+ include :
194+ - os : ubuntu-latest
195+ targets :
196+ - aarch64-linux-android
197+ - i686-unknown-linux-gnu
198+ - i686-unknown-linux-musl
199+ - wasm32-wasip2
200+ - x86_64-unknown-freebsd
201+ dependencies :
202+ gcc-multilib : true
203+ musl-tools : true
204+ - os : ubuntu-latest
205+ targets :
206+ - aarch64-unknown-linux-gnu
207+ dependencies :
208+ gcc-aarch64-linux-gnu : true # conflict with `gcc-multilib`
209+ - os : macos-latest
210+ targets :
211+ - aarch64-apple-ios
212+ - x86_64-apple-darwin
213+ fail-fast : false
213214 steps :
214- - uses : actions/checkout@v6.0.2
215- - uses : dtolnay/rust-toolchain@stable
215+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
216216 with :
217- target : i686-unknown-linux-gnu
217+ persist-credentials : false
218218
219- - name : Install gcc-multilib and musl-tools
220- run : sudo apt-get update && sudo apt-get install gcc-multilib musl-tools
221- - name : Check compilation for x86 32bit
222- run : cargo check --target i686-unknown-linux-gnu ${{ env.CARGO_ARGS_NO_SSL }}
219+ - uses : Swatinem/rust-cache@v2
220+ with :
221+ prefix-key : v0-rust-${{ join(matrix.targets, '-') }}
222+
223+ - name : Install dependencies
224+ uses : ./.github/actions/install-linux-deps
225+ with : ${{ matrix.dependencies || fromJSON('{}') }}
223226
224227 - uses : dtolnay/rust-toolchain@stable
225228 with :
226- target : aarch64-linux-android
229+ targets : ${{ join(matrix.targets, ',') }}
227230
228231 - name : Setup Android NDK
232+ if : ${{ contains(matrix.targets, 'aarch64-linux-android') }}
229233 id : setup-ndk
230234 uses : nttld/setup-ndk@v1
231235 with :
232236 ndk-version : r27
233237 add-to-path : true
234238
235- - name : Check compilation for android
236- run : cargo check --target aarch64-linux-android ${{ env.CARGO_ARGS_NO_SSL }}
237- env :
238- CC_aarch64_linux_android : ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang
239- AR_aarch64_linux_android : ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
240- CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER : ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang
241-
242- - uses : dtolnay/rust-toolchain@stable
243- with :
244- target : aarch64-unknown-linux-gnu
245-
246- - name : Install gcc-aarch64-linux-gnu
247- run : sudo apt install gcc-aarch64-linux-gnu
248- - name : Check compilation for aarch64 linux gnu
249- run : cargo check --target aarch64-unknown-linux-gnu ${{ env.CARGO_ARGS_NO_SSL }}
250-
251- - uses : dtolnay/rust-toolchain@stable
252- with :
253- target : i686-unknown-linux-musl
254-
255- - name : Check compilation for musl
256- run : cargo check --target i686-unknown-linux-musl ${{ env.CARGO_ARGS_NO_SSL }}
257-
258- - uses : dtolnay/rust-toolchain@stable
259- with :
260- target : x86_64-unknown-freebsd
261-
262- - name : Check compilation for freebsd
263- run : cargo check --target x86_64-unknown-freebsd ${{ env.CARGO_ARGS_NO_SSL }}
264-
265- - uses : dtolnay/rust-toolchain@stable
266- with :
267- target : wasm32-wasip2
268-
269- - name : Check compilation for wasip2
270- run : cargo check --target wasm32-wasip2 ${{ env.CARGO_ARGS_NO_SSL }}
271-
272239 # - name: Prepare repository for redox compilation
273240 # run: bash scripts/redox/uncomment-cargo.sh
274241 # - name: Check compilation for Redox
@@ -277,6 +244,19 @@ jobs:
277244 # command: check
278245 # args: --ignore-rust-version
279246
247+ - name : Check compilation
248+ run : |
249+ for target in ${{ join(matrix.targets, ' ') }}
250+ do
251+ echo "::group::${target}"
252+ cargo check --target $target ${{ env.CARGO_ARGS_NO_SSL }}
253+ echo "::endgroup::"
254+ done
255+ env :
256+ CC_aarch64_linux_android : ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang
257+ AR_aarch64_linux_android : ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
258+ CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER : ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang
259+
280260 snippets_cpython :
281261 if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
282262 env :
@@ -291,7 +271,7 @@ jobs:
291271 - windows-2025
292272 fail-fast : false
293273 steps :
294- - uses : actions/checkout@v6.0.2
274+ - uses : actions/checkout@v6
295275 - uses : dtolnay/rust-toolchain@stable
296276 - uses : Swatinem/rust-cache@v2
297277 - uses : actions/setup-python@v6.2.0
@@ -453,7 +433,7 @@ jobs:
453433 name : Lint Rust & Python code
454434 runs-on : ubuntu-latest
455435 steps :
456- - uses : actions/checkout@v6.0.2
436+ - uses : actions/checkout@v6
457437 - uses : actions/setup-python@v6.2.0
458438 with :
459439 python-version : ${{ env.PYTHON_VERSION }}
@@ -481,7 +461,7 @@ jobs:
481461 - name : Install ruff
482462 uses : astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1
483463 with :
484- version : " 0.15.4 "
464+ version : " 0.15.5 "
485465 args : " --version"
486466
487467 - run : ruff check --diff
@@ -511,7 +491,7 @@ jobs:
511491 env :
512492 NIGHTLY_CHANNEL : nightly
513493 steps :
514- - uses : actions/checkout@v6.0.2
494+ - uses : actions/checkout@v6
515495
516496 - uses : dtolnay/rust-toolchain@master
517497 with :
@@ -533,7 +513,7 @@ jobs:
533513 runs-on : ubuntu-latest
534514 timeout-minutes : 30
535515 steps :
536- - uses : actions/checkout@v6.0.2
516+ - uses : actions/checkout@v6
537517 - uses : dtolnay/rust-toolchain@stable
538518
539519 - uses : Swatinem/rust-cache@v2
@@ -596,16 +576,20 @@ jobs:
596576 runs-on : ubuntu-latest
597577 timeout-minutes : 30
598578 steps :
599- - uses : actions/checkout@v6.0.2
579+ - uses : actions/checkout@v6
600580 - uses : dtolnay/rust-toolchain@stable
601581 with :
602582 target : wasm32-wasip1
603583
604584 - uses : Swatinem/rust-cache@v2
605585 - name : Setup Wasmer
606586 uses : wasmerio/setup-wasmer@v3
587+
607588 - name : Install clang
608- run : sudo apt-get update && sudo apt-get install clang -y
589+ uses : ./.github/actions/install-linux-deps
590+ with :
591+ clang : true
592+
609593 - name : build rustpython
610594 run : cargo build --release --target wasm32-wasip1 --features freeze-stdlib,stdlib --verbose
611595 - name : run snippets
0 commit comments