From ea7c281a47f7acd43fa8a9719e18f1214979ddef Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Mon, 9 Jan 2023 17:21:31 -0500 Subject: [PATCH] Move to dtolnay/toolchain (#211) * Move to dtolnay/toolchain * Correct dtolnay/toolchain to rust-roolchain * Pass toolchain by argument instead of revision Introduces malleability by referring to HEAD of dtolnay, yet GHA errored on the prior syntax. --- .github/actions/build-dependencies/action.yml | 7 ++-- .github/actions/cached-rust/action.yml | 34 ------------------- .github/workflows/daily-deny.yml | 5 +-- .github/workflows/tests.yml | 9 ++--- 4 files changed, 6 insertions(+), 49 deletions(-) delete mode 100644 .github/actions/cached-rust/action.yml diff --git a/.github/actions/build-dependencies/action.yml b/.github/actions/build-dependencies/action.yml index 15db381e..44f9c1cd 100644 --- a/.github/actions/build-dependencies/action.yml +++ b/.github/actions/build-dependencies/action.yml @@ -33,7 +33,7 @@ runs: solc-select use 0.8.16 - name: Install Rust - uses: ./.github/actions/cached-rust + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ inputs.rust-toolchain }} components: ${{ inputs.rust-components }} @@ -44,8 +44,7 @@ runs: run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT - name: Install WASM toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ steps.nightly.outputs.version }} - profile: minimal - target: wasm32-unknown-unknown + targets: wasm32-unknown-unknown diff --git a/.github/actions/cached-rust/action.yml b/.github/actions/cached-rust/action.yml deleted file mode 100644 index 09ae995e..00000000 --- a/.github/actions/cached-rust/action.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: cached-rust -description: Installs Rust, caching ~/.cargo and ./target - -inputs: - toolchain: - description: "Toolchain to install" - required: false - default: stable - - components: - description: "Components to install" - required: false - default: - -runs: - using: "composite" - steps: - - name: Rust Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ./target - key: ${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.install-rust.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.install-rust.outputs.rustc_hash }}- - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ inputs.toolchain }} - profile: minimal - default: true - components: ${{ inputs.components }} diff --git a/.github/workflows/daily-deny.yml b/.github/workflows/daily-deny.yml index 01e8e6a7..460f4b5a 100644 --- a/.github/workflows/daily-deny.yml +++ b/.github/workflows/daily-deny.yml @@ -18,10 +18,7 @@ jobs: key: rust-advisory-db - name: Install cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal + uses: dtolnay/rust-toolchain@stable - name: Install cargo deny run: cargo install --locked cargo-deny diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 07581c51..079e1fa1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,10 +40,7 @@ jobs: key: rust-advisory-db - name: Install cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal + uses: dtolnay/rust-toolchain@stable - name: Install cargo deny run: cargo install --locked cargo-deny @@ -73,12 +70,10 @@ jobs: id: nightly run: echo "version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT - # Doesn't grab the cache as it's not needed - name: Install rustfmt - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ steps.nightly.outputs.version }} - profile: minimal components: rustfmt - name: Run rustfmt