Skip to content

Commit

Permalink
ci: Add toolchain/components inputs to setup-rust
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Sep 25, 2024
1 parent 83f9a8f commit e7796f7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
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
steps:
- 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 `<cmd> +<toolchain>` for clarity.
override: false
7 changes: 6 additions & 1 deletion .github/workflows/edr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e7796f7

Please sign in to comment.