-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use matrix for cargo check
#7388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,102 +188,71 @@ jobs: | |
| PYTHONPATH: scripts | ||
| if: runner.os == 'Linux' | ||
|
|
||
| - name: prepare Intel MacOS build | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| target: x86_64-apple-darwin | ||
| if: runner.os == 'macOS' | ||
| - name: Check compilation for Intel MacOS | ||
| run: cargo check --target x86_64-apple-darwin | ||
| if: runner.os == 'macOS' | ||
| - name: prepare iOS build | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| target: aarch64-apple-ios | ||
| if: runner.os == 'macOS' | ||
| - name: Check compilation for iOS | ||
| run: cargo check --target aarch64-apple-ios ${{ env.CARGO_ARGS_NO_SSL }} | ||
| if: runner.os == 'macOS' | ||
|
|
||
| exotic_targets: | ||
| cargo_check: | ||
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }} | ||
| name: Ensure compilation on various targets | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-latest | ||
| targets: | ||
| - aarch64-linux-android | ||
| - i686-unknown-linux-gnu | ||
| - i686-unknown-linux-musl | ||
| - wasm32-wasip2 | ||
| - x86_64-unknown-freebsd | ||
| dependencies: | ||
| gcc-multilib: true | ||
| musl-tools: true | ||
| - os: ubuntu-latest | ||
| targets: | ||
| - aarch64-unknown-linux-gnu | ||
| dependencies: | ||
| gcc-aarch64-linux-gnu: true # conflict with `gcc-multilib` | ||
| - os: macos-latest | ||
| targets: | ||
| - aarch64-apple-ios | ||
| - x86_64-apple-darwin | ||
| fail-fast: false | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| target: i686-unknown-linux-gnu | ||
| persist-credentials: false | ||
|
|
||
| - name: Install gcc-multilib and musl-tools | ||
| uses: ./.github/actions/install-linux-deps | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| gcc-multilib: true | ||
| musl-tools: true | ||
| prefix-key: v0-rust-${{ join(matrix.targets, '-') }} | ||
|
|
||
| - name: Check compilation for x86 32bit | ||
| run: cargo check --target i686-unknown-linux-gnu ${{ env.CARGO_ARGS_NO_SSL }} | ||
| - name: Install dependencies | ||
| uses: ./.github/actions/install-linux-deps | ||
| with: ${{ matrix.dependencies || fromJSON('{}') }} | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| target: aarch64-linux-android | ||
| targets: ${{ join(matrix.targets, ',') }} | ||
|
|
||
| - name: Setup Android NDK | ||
| if: ${{ contains(matrix.targets, 'aarch64-linux-android') }} | ||
| id: setup-ndk | ||
| uses: nttld/setup-ndk@v1 | ||
| with: | ||
| ndk-version: r27 | ||
| add-to-path: true | ||
|
|
||
| - name: Check compilation for android | ||
| run: cargo check --target aarch64-linux-android ${{ env.CARGO_ARGS_NO_SSL }} | ||
| - name: Check compilation | ||
| run: | | ||
| for target in ${{ join(matrix.targets, ' ') }} | ||
| do | ||
| echo "::group::${target}" | ||
| cargo check --target $target ${{ env.CARGO_ARGS_NO_SSL }} | ||
| echo "::endgroup::" | ||
| done | ||
| env: | ||
| CC_aarch64_linux_android: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang | ||
| AR_aarch64_linux_android: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar | ||
| CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| target: aarch64-unknown-linux-gnu | ||
|
|
||
| - name: Install gcc-aarch64-linux-gnu | ||
| uses: ./.github/actions/install-linux-deps | ||
| with: | ||
| gcc-aarch64-linux-gnu: true | ||
|
|
||
| - name: Check compilation for aarch64 linux gnu | ||
| run: cargo check --target aarch64-unknown-linux-gnu ${{ env.CARGO_ARGS_NO_SSL }} | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| target: i686-unknown-linux-musl | ||
|
|
||
| - name: Check compilation for musl | ||
| run: cargo check --target i686-unknown-linux-musl ${{ env.CARGO_ARGS_NO_SSL }} | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| target: x86_64-unknown-freebsd | ||
|
|
||
| - name: Check compilation for freebsd | ||
| run: cargo check --target x86_64-unknown-freebsd ${{ env.CARGO_ARGS_NO_SSL }} | ||
|
|
||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| target: wasm32-wasip2 | ||
|
|
||
| - name: Check compilation for wasip2 | ||
| run: cargo check --target wasm32-wasip2 ${{ env.CARGO_ARGS_NO_SSL }} | ||
|
|
||
| # - name: Prepare repository for redox compilation | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where should redox to be put?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In one of the target groups. I can try to do in a separate PR. this PR isn't meant to change existing behavior. I assume we will have a special condition for it like we do in the setup-ndk step |
||
| # run: bash scripts/redox/uncomment-cargo.sh | ||
| # - name: Check compilation for Redox | ||
| # uses: coolreader18/redoxer-action@v1 | ||
| # with: | ||
| # command: check | ||
| # args: --ignore-rust-version | ||
|
|
||
| snippets_cpython: | ||
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }} | ||
| env: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 47
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 110
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 1730
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 1579
🏁 Script executed:
Repository: RustPython/RustPython
Length of output: 1453
Fix the schema violation:
with:must be a mapping, not a scalar expression.Line 229 passes a scalar expression where GitHub Actions requires an explicit mapping. Flatten the matrix flags into individual booleans and bind each action input explicitly.
Proposed fix
matrix: include: - os: ubuntu-latest targets: - aarch64-linux-android - i686-unknown-linux-gnu - i686-unknown-linux-musl - wasm32-wasip2 - x86_64-unknown-freebsd - dependencies: - gcc-multilib: true - musl-tools: true + gcc_multilib: true + musl_tools: true - os: ubuntu-latest targets: - aarch64-unknown-linux-gnu - dependencies: - gcc-aarch64-linux-gnu: true # conflict with `gcc-multilib` + gcc_aarch64_linux_gnu: true # conflict with `gcc-multilib` - os: macos-latest targets: - aarch64-apple-ios - x86_64-apple-darwin fail-fast: false ... - name: Install dependencies + if: runner.os == 'Linux' uses: ./.github/actions/install-linux-deps - with: ${{ matrix.dependencies || fromJSON('{}') }} + with: + gcc-multilib: ${{ matrix.gcc_multilib || false }} + musl-tools: ${{ matrix.musl_tools || false }} + clang: ${{ matrix.clang || false }} + gcc-aarch64-linux-gnu: ${{ matrix.gcc_aarch64_linux_gnu || false }}📝 Committable suggestion
🧰 Tools
🪛 actionlint (1.7.11)
[error] 229-229: "with" section is scalar node but mapping node is expected
(syntax-check)
🤖 Prompt for AI Agents