diff --git a/.github/workflows/__call-common-lint.yml b/.github/workflows/__call-common-lint.yml index 73b8b6e4..6479e28f 100644 --- a/.github/workflows/__call-common-lint.yml +++ b/.github/workflows/__call-common-lint.yml @@ -244,26 +244,16 @@ jobs: echo "found_cargo=false" >> $GITHUB_OUTPUT fi - - name: Rust - setup toolchain - if: always() && steps.run_cargo.outputs.found_cargo == 'true' - env: - RUST_COMPONENTS: rustfmt - run: | - # If no toolchain file exists, set to stable - if [ ! -f "rust-toolchain.toml" ] && [ ! -f "rust-toolchain" ]; then - rustup default stable - fi - - # Install components for the active toolchain - rustup component add ${RUST_COMPONENTS} - - # Display current toolchain information - rustup show + - name: Setup Rust + uses: actions-rust-lang/setup-rust-toolchain@v1.12.0 + with: + target: ${{ matrix.target }} + components: 'rustfmt' + cache: false - name: Rust - cargo fmt if: always() && steps.run_cargo.outputs.found_cargo == 'true' - run: | - cargo fmt -- --check + run: cargo fmt -- --check - name: YAML - find files id: yaml_files