Use matrix for cargo check#7388
Conversation
📝 WalkthroughWalkthroughReplaced per-target CI steps with a matrix-driven Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as GitHub Runner
participant Action as install-linux-deps Action
participant Apt as apt-get
participant Toolchain as rustup / toolchain
participant Cache as action/cache
participant NDK as Android NDK (conditional)
participant Cargo as cargo check
Runner->>Action: invoke with inputs (e.g., gcc-aarch64-linux-gnu)
Action->>Apt: apt-get install --no-install-recommends (add arm64 cross pkgs if input=true)
Runner->>Toolchain: setup Rust toolchain and add targets
Runner->>Cache: restore/save cargo cache
alt Android target present
Runner->>NDK: setup Android NDK
end
Runner->>Cargo: loop over matrix targets -> cargo check (per-target env)
Cargo-->>Runner: return check results
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yaml:
- Around line 197-229: The Install dependencies step uses a scalar expression
for with: (with: ${{ matrix.dependencies || fromJSON('{}') }}) which violates
GitHub Actions schema; change the with: to an explicit mapping of the action
inputs (the boolean flags) instead of a single scalar. Update the step that uses
./.github/actions/install-linux-deps so its with: lists each dependency key as a
mapping entry (e.g., gcc-multilib, musl-tools, gcc-aarch64-linux-gnu) and set
each value to a safe expression that reads the matrix entry with a default
(e.g., ${{ matrix.dependencies.gcc-multilib || false }}), ensuring every
possible dependency key in the matrix is represented as a boolean input.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 81db98f2-101c-44e3-9ba0-013dbad11b83
📒 Files selected for processing (2)
.github/actions/install-linux-deps/action.yml.github/workflows/ci.yaml
Sorry, something went wrong.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/ci.yaml (1)
227-229: ⚠️ Potential issue | 🔴 CriticalFix the
Install dependenciesstep shape and scope.Line 229 is invalid GitHub Actions syntax:
with:must be a mapping, so this job will not pass workflow validation. Even after that is fixed, this step still runs for themacos-latestrow even though it invokes the Linux-onlyinstall-linux-depsaction.One working shape
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 ... - 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 }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yaml around lines 227 - 229, The "Install dependencies" step uses invalid YAML for the with: field and also unconditionally invokes the Linux-only action ./.github/actions/install-linux-deps for non-Linux matrix rows; change the step to provide a proper mapping for the inputs (e.g., a key like dependencies mapped to the expression using matrix.dependencies) and add a conditional that restricts the step to Linux matrix entries (use matrix.os in the if: expression) so the step only runs for Linux jobs and the with: block is valid.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.github/workflows/ci.yaml:
- Around line 227-229: The "Install dependencies" step uses invalid YAML for the
with: field and also unconditionally invokes the Linux-only action
./.github/actions/install-linux-deps for non-Linux matrix rows; change the step
to provide a proper mapping for the inputs (e.g., a key like dependencies mapped
to the expression using matrix.dependencies) and add a conditional that
restricts the step to Linux matrix entries (use matrix.os in the if: expression)
so the step only runs for Linux jobs and the with: block is valid.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 68bac21c-80f5-4e72-a059-13705ac74f77
📒 Files selected for processing (1)
.github/workflows/ci.yaml
Sorry, something went wrong.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/ci.yaml (1)
227-229: ⚠️ Potential issue | 🔴 CriticalSchema violation:
with:requires a mapping, not a scalar expression.The syntax
with: ${{ matrix.dependencies || fromJSON('{}') }}is invalid. GitHub Actions expectswith:to contain an explicit mapping of input names to values. Additionally, this step will run on macOS whereinstall-linux-depsis not applicable.The fix proposed in the previous review remains valid—flatten the dependency flags to top-level matrix properties and bind them explicitly with an OS condition.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yaml around lines 227 - 229, The CI step "Install dependencies" uses an invalid scalar for with: and is not guarded by OS; change the step to pass a mapping (e.g. with: dependencies: ${{ matrix.dependencies }} ) and add an OS guard (if: runner.os == 'Linux') so the local action ./.github/actions/install-linux-deps only runs on Linux; also ensure your matrix defines the top-level property matrix.dependencies (use fromJSON default when building the matrix if needed) so the referenced matrix key exists.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.github/workflows/ci.yaml:
- Around line 227-229: The CI step "Install dependencies" uses an invalid scalar
for with: and is not guarded by OS; change the step to pass a mapping (e.g.
with: dependencies: ${{ matrix.dependencies }} ) and add an OS guard (if:
runner.os == 'Linux') so the local action ./.github/actions/install-linux-deps
only runs on Linux; also ensure your matrix defines the top-level property
matrix.dependencies (use fromJSON default when building the matrix if needed) so
the referenced matrix key exists.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 2aaff4f0-652d-4034-a957-2a97a27a6ca8
📒 Files selected for processing (1)
.github/workflows/ci.yaml
Sorry, something went wrong.
7e47270
into
RustPython:main
Mar 11, 2026
* Use matrix for cargo_check * Tweak `gcc-aarch64-linux-gnu` deps * Re-add redox comment
* Use matrix for cargo_check * Tweak `gcc-aarch64-linux-gnu` deps * Re-add redox comment
Summary by CodeRabbit