ci(l1, l2): create reusable step to install rust#3591
Merged
Conversation
To remove the usage of the RUST_VERSION GitHub Variable. GitHub Variables are excluded from workflow runs triggered by PRs from forks, so we need to remove this variable dependency in order for external collaborators to send PRs and run the CI
So the rust-toolchain.toml file is present
|
No significant difference was registered for any benchmark run. Detailed ResultsBenchmark Results: BubbleSort
Benchmark Results: ERC20Approval
Benchmark Results: ERC20Mint
Benchmark Results: ERC20Transfer
Benchmark Results: Factorial
Benchmark Results: FactorialRecursive
Benchmark Results: Fibonacci
Benchmark Results: FibonacciRecursive
Benchmark Results: ManyHashes
Benchmark Results: MstoreBench
Benchmark Results: Push
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a reusable composite action for setting up Rust across workflows, removing direct dependency on repository variables so that CI runs properly for forked PRs.
- Added a
setup-rustcomposite action that extracts the Rust version fromrust-toolchain.toml, installs the toolchain, and caches dependencies. - Updated multiple workflow files to replace individual Rust install and cache steps with
Setup Rust Environment. - Standardized step naming and ordering in workflows to improve consistency.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/actions/setup-rust/action.yml | New composite action to install Rust and cache dependencies |
| .github/workflows/pr_perf_trie.yml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr_perf_levm.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr_perf_build_block_bench.yml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr_perf_blocks_exec.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr_loc.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr_lint_readme.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr-main_levm.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr-main_l2_tdx.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr-main_l2_contracts.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr-main_l2.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/pr-main_l1.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/main_prover_l1.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/main_prover.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/main_perf_blocks_exec.yml | Replaced Rust install and cache steps with composite action |
| .github/workflows/main_flamegraph_report.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/daily_loc.yaml | Replaced Rust install and cache steps with composite action |
| .github/workflows/common_hive_reports.yaml | Replaced Rust install and cache steps with composite action |
Comments suppressed due to low confidence (2)
.github/workflows/pr_perf_blocks_exec.yaml:26
- The
Setup Rust Environmentstep is declared before checking out sources, sorust-toolchain.tomlwon’t be available for version extraction. Move theCheckout sourcesstep above this step.
- name: Setup Rust Environment
.github/actions/setup-rust/action.yml:26
- [nitpick] Consider adding an input for
cache-on-failureto the composite action so workflows can preserve the previous cache failure behavior when needed.
- name: Add Rust Cache
ilitteri
approved these changes
Jul 10, 2025
jrchatruc
approved these changes
Jul 10, 2025
d-roak
pushed a commit
to 1sixtech/ethrex
that referenced
this pull request
Jul 17, 2025
Continuation of lambdaclass#3318 **Motivation** GitHub Variables are excluded from workflow runs triggered by PRs from forks, so we need to remove this variable dependency in order for external collaborators to send PRs and run the CI properly **Description** * The `Extract Rust version from rust-toolchain.toml` step (`id: rustver`) uses `grep` and `sed` to extract the rust version from the `rust-toolchain.toml` file that is in the root of the repository. * The `Install Rust` step utilizes the output of the previous step to send the version to the `toolchain` parameter * Note that in some cases, I had to move the `Checkout` step further up (it's also good practice to put it as high up as possible) so the `rust-toolchain.toml` file is available to be read. --------- Co-authored-by: Klaus Lungwitz <klaus.lungwitz@lambdaclass.com> Co-authored-by: Javier Rodríguez Chatruc <49622509+jrchatruc@users.noreply.github.com>
pedrobergamini
pushed a commit
to pedrobergamini/ethrex
that referenced
this pull request
Aug 24, 2025
Continuation of lambdaclass#3318 **Motivation** GitHub Variables are excluded from workflow runs triggered by PRs from forks, so we need to remove this variable dependency in order for external collaborators to send PRs and run the CI properly **Description** * The `Extract Rust version from rust-toolchain.toml` step (`id: rustver`) uses `grep` and `sed` to extract the rust version from the `rust-toolchain.toml` file that is in the root of the repository. * The `Install Rust` step utilizes the output of the previous step to send the version to the `toolchain` parameter * Note that in some cases, I had to move the `Checkout` step further up (it's also good practice to put it as high up as possible) so the `rust-toolchain.toml` file is available to be read. --------- Co-authored-by: Klaus Lungwitz <klaus.lungwitz@lambdaclass.com> Co-authored-by: Javier Rodríguez Chatruc <49622509+jrchatruc@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation of #3318
Motivation
GitHub Variables are excluded from workflow runs triggered by PRs from forks, so we need to remove this variable dependency in order for external collaborators to send PRs and run the CI properly
Description
Extract Rust version from rust-toolchain.tomlstep (id: rustver) usesgrepandsedto extract the rust version from therust-toolchain.tomlfile that is in the root of the repository.Install Ruststep utilizes the output of the previous step to send the version to thetoolchainparameterCheckoutstep further up (it's also good practice to put it as high up as possible) so therust-toolchain.tomlfile is available to be read.