From 847169c8432cf2c9579e2f29743954c9417dd780 Mon Sep 17 00:00:00 2001 From: Lars Lubkoll <11710767+lubkoll@users.noreply.github.com> Date: Thu, 18 Jul 2024 08:22:49 +0200 Subject: [PATCH] Add caching --- .github/workflows/rust_basic.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust_basic.yml b/.github/workflows/rust_basic.yml index adfc4b0cd..c0f89a0a7 100644 --- a/.github/workflows/rust_basic.yml +++ b/.github/workflows/rust_basic.yml @@ -22,6 +22,16 @@ jobs: - name: Install Rust if: env.GIT_DIFF uses: dtolnay/rust-toolchain@stable + - name: Restore dependencies + if: env.GIT_DIFF + uses: actions/cache@v4 + with: + path: | + ~/.cargo + ~/go + **/target + key: ${{ runner.os }}-cargo-$${{ hashFiles('smart-contracts/Cargo.toml') }} + restore-keys: ${{ runner.os }}-cargo - name: Rust lint if: env.GIT_DIFF run: RUSTFLAGS="-Dwarnings" cargo clippy --workspace -- -D warnings --A deprecated @@ -34,5 +44,3 @@ jobs: if: env.GIT_DIFF run: cargo unit-test working-directory: smart-contracts/contracts/${{ inputs.contract }} - - name: tststs - run: ls -al ${HOME}