Skip to content

Commit 2dc3dec

Browse files
fix(lint): use setup-rust-toolchain action (#471)
1 parent e3b8d2d commit 2dc3dec

1 file changed

Lines changed: 7 additions & 17 deletions

File tree

.github/workflows/__call-common-lint.yml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -244,26 +244,16 @@ jobs:
244244
echo "found_cargo=false" >> $GITHUB_OUTPUT
245245
fi
246246
247-
- name: Rust - setup toolchain
248-
if: always() && steps.run_cargo.outputs.found_cargo == 'true'
249-
env:
250-
RUST_COMPONENTS: rustfmt
251-
run: |
252-
# If no toolchain file exists, set to stable
253-
if [ ! -f "rust-toolchain.toml" ] && [ ! -f "rust-toolchain" ]; then
254-
rustup default stable
255-
fi
256-
257-
# Install components for the active toolchain
258-
rustup component add ${RUST_COMPONENTS}
259-
260-
# Display current toolchain information
261-
rustup show
247+
- name: Setup Rust
248+
uses: actions-rust-lang/setup-rust-toolchain@v1.12.0
249+
with:
250+
target: ${{ matrix.target }}
251+
components: 'rustfmt'
252+
cache: false
262253

263254
- name: Rust - cargo fmt
264255
if: always() && steps.run_cargo.outputs.found_cargo == 'true'
265-
run: |
266-
cargo fmt -- --check
256+
run: cargo fmt -- --check
267257

268258
- name: YAML - find files
269259
id: yaml_files

0 commit comments

Comments
 (0)