diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index 0c069c933..7104d9179 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -1,5 +1,12 @@ name: Setup Rust description: Sets up Rust +inputs: + toolchain: + description: The Rust toolchain to use + required: false + components: + description: Comma-separated list of components to install + required: false runs: using: composite @@ -7,10 +14,15 @@ runs: - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - components: clippy + # Empty string means rust-toolchain if it exists, otherwise stable + toolchain: ${{ inputs.toolchain }} + components: ${{ inputs.components }} cache: true # Do not override the RUSTFLAGS by default and instead do that per job, # if needed. Setting RUSTFLAGS via env var, config, etc. is mutually # exclusive and often a source of bugs. # Empty string here means no override. rustflags: "" + # By default, we do not override the toolchain from rust-toolchain. + # The user needs to explicitly use ` +` for clarity. + override: false diff --git a/.github/workflows/edr-ci.yml b/.github/workflows/edr-ci.yml index 553659194..94ea743b9 100644 --- a/.github/workflows/edr-ci.yml +++ b/.github/workflows/edr-ci.yml @@ -83,9 +83,14 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/setup-rust + with: + components: clippy - name: Install nightly rustfmt - run: rustup toolchain install nightly --profile minimal --component rustfmt + uses: ./.github/actions/setup-rust + with: + toolchain: nightly + components: rustfmt - name: Run cargo fmt run: cargo +nightly fmt --all --check