diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index f058bdb91a..0e99243acc 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -85,12 +85,18 @@ jobs: VAULT_TOKEN: "root" VAULT_ADDR: "http://127.0.0.1:8200" steps: - - name: Install rustup - run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain 1.70.0 - - name: Check out code uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + # Rustup will detect toolchain version and profile from rust-toolchain.toml + # It will download and install the toolchain and components automatically + # and make them available for subsequent commands + - name: Install Rust toolchain + run: rustup show + + - name: Show Rust version + run: cargo --version + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: sops-linux-amd64-${{ github.sha }} diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 4635bd6c93..62ea2373c8 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -22,8 +22,14 @@ jobs: - name: Check out code uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - name: Install rustup - run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain 1.70.0 + # Rustup will detect toolchain version and profile from rust-toolchain.toml + # It will download and install the toolchain and components automatically + # and make them available for subsequent commands + - name: Install Rust toolchain and additional components + run: rustup component add rustfmt + + - name: Show Rust version + run: cargo --version - name: Run Formatting Check run: cargo fmt --check diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..9289042575 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.70.0" +profile = "minimal"