diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2bc0037a..ff4e82e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,15 +15,11 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Cache ~/.cargo/bin directory - id: cargo-bin-cache - uses: actions/cache@v2.1.4 - with: - path: ~/.cargo/bin - key: ubuntu-rust-${{ hashFiles('rust-toolchain') }}-cargo-bin-directory-v1 + - uses: Swatinem/rust-cache@v1.2.0 + id: cache - name: Install tomlfmt - if: steps.cargo-bin-cache.outputs.cache-hit != 'true' + if: steps.cache.outputs.cache-hit != 'true' run: cargo install cargo-tomlfmt - name: Check Cargo.toml formatting @@ -58,13 +54,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - 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') }}-${{ hashFiles('rust-toolchain') }}-v1 + - uses: Swatinem/rust-cache@v1.2.0 - name: Build binary run: | @@ -99,13 +89,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - 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') }}-${{ hashFiles('rust-toolchain') }}-v1 + - uses: Swatinem/rust-cache@v1.2.0 - name: Build tests run: cargo build --tests --workspace --all-features @@ -135,13 +119,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - 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') }}-${{ hashFiles('rust-toolchain') }}-v1 + - uses: Swatinem/rust-cache@v1.2.0 - name: Run test ${{ matrix.test_name }} run: cargo test --package swap --all-features --test ${{ matrix.test_name }} "" diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 24b6635b..69c7e578 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -27,6 +27,8 @@ jobs: ref: ${{ github.event.release.target_commitish }} token: ${{ secrets.BOTTY_GITHUB_TOKEN }} + - uses: Swatinem/rust-cache@v1.2.0 + - name: Build ${{ matrix.target }} release binary run: cargo build --target=${{ matrix.target }} --release --package swap --bin swap_cli