From 2d6b4419e9202d1bbf3d0526d190e17dc4e180ad Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Thu, 1 Jun 2023 13:19:56 +0200 Subject: [PATCH] ci: remove usage of actions-rs/toolchain@v1 as it is not actively maintained dtolnay/rust-toolchain provides similar functionality, however requires an additional step when using the nightly toolchain because it does not support the override option. Signed-off-by: Reuben Miller --- .github/workflows/pull-request-checks.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml index 0b577631392..98627c985eb 100644 --- a/.github/workflows/pull-request-checks.yml +++ b/.github/workflows/pull-request-checks.yml @@ -93,10 +93,11 @@ jobs: - uses: actions/checkout@v3 - name: Install nightly toolchain - uses: actions-rs/toolchain@v1 + id: toolchain + uses: dtolnay/rust-toolchain@master with: toolchain: nightly - override: true + - run: rustup override set ${{steps.toolchain.outputs.name}} - name: Run cargo-udeps uses: aig787/cargo-udeps-action@v1 @@ -202,12 +203,17 @@ jobs: uses: actions/checkout@v3 # Nightly toolchain is needed for cargo fmt since issue: https://github.com/thin-edge/thin-edge.io/issues/1660 + # dtolnay/rust-toolchain is preferred over actions-rs/toolchain is currently not maintained and currently using + # deprecated GHA api (see https://github.com/actions-rs/toolchain/issues/219). + # However since dtolnay/rust-toolchain does not support the 'override' option, an additional call to + # rustup override is required (see https://github.com/dtolnay/rust-toolchain/issues/29#issuecomment-1412903426) - name: Install nightly toolchain - uses: actions-rs/toolchain@v1 + id: toolchain + uses: dtolnay/rust-toolchain@master with: toolchain: nightly components: rustfmt - override: true + - run: rustup override set ${{steps.toolchain.outputs.name}} - name: Cargo fmt --version uses: actions-rs/cargo@v1