diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89842a1c..caaffef1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,19 +15,12 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - components: rustfmt, clippy - - name: Cache ~/.cargo/bin directory id: cargo-bin-cache uses: actions/cache@v2.1.4 with: path: ~/.cargo/bin - key: ubuntu-rust-${{ env.RUST_TOOLCHAIN }}-cargo-bin-directory-v1 + key: ubuntu-rust-${{ hashFiles('rust-toolchain') }}-cargo-bin-directory-v1 - name: Install tomlfmt if: steps.cargo-bin-cache.outputs.cache-hit != 'true' @@ -63,19 +56,13 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - - name: Cache target and registry directory uses: actions/cache@v2.1.4 with: path: | target ~/.cargo/registry - key: rust-${{ matrix.target }}-build-${{ hashFiles('Cargo.lock') }}-v1 + key: rust-${{ matrix.target }}-build-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('rust-toolchain') }}-v1 - name: Build binary run: | @@ -110,19 +97,13 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - - name: Cache target and registry directory uses: actions/cache@v2.1.4 with: path: | target ~/.cargo/registry - key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-v1 + key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('rust-toolchain') }}-v1 - name: Build tests run: cargo build --tests --workspace --all-features @@ -152,19 +133,13 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - - name: Cache target and registry directory uses: actions/cache@v2.1.4 with: path: | target ~/.cargo/registry - key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-v1 + key: rust-${{ matrix.target }}-test-${{ hashFiles('Cargo.lock') }}-${{ hashFiles('rust-toolchain') }}-v1 - name: Run test ${{ matrix.test_name }} run: cargo test --package swap --all-features --test ${{ matrix.test_name }} "" diff --git a/rust-toolchain b/rust-toolchain index 97e6da5f..b431082c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1,3 @@ -nightly-2021-01-31 +[toolchain] +channel = "nightly-2021-01-31" +components = ["rustfmt", "clippy"]