From cab2df8a4777d5cf75096fabcefb8430073e22dd Mon Sep 17 00:00:00 2001 From: Lars Lubkoll <11710767+lubkoll@users.noreply.github.com> Date: Wed, 21 Aug 2024 19:49:19 +0000 Subject: [PATCH] Add cachepot to pre-commit verification --- .github/workflows/cargo_build_cache.yml | 8 +++++--- .github/workflows/cargo_build_cache_osmosis.yml | 1 + .github/workflows/cl_vault_osmosis.yml | 1 + .github/workflows/rust_basic.yml | 10 +++++----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cargo_build_cache.yml b/.github/workflows/cargo_build_cache.yml index 3076a3a62..37c17b19a 100644 --- a/.github/workflows/cargo_build_cache.yml +++ b/.github/workflows/cargo_build_cache.yml @@ -15,15 +15,17 @@ jobs: uses: actions/checkout@v3 - name: Install Rust uses: dtolnay/rust-toolchain@stable + - name: Install cachepot + run: cargo install --git https://github.com/paritytech/cachepot - name: Rust check - run: cargo check + run: RUSTC_WRAPPER="$HOME/.cargo/bin/cachepot" cargo check working-directory: smart-contracts/${{ inputs.workspace }} - name: Store dependencies uses: actions/cache/save@v4 with: path: | + ~/.cache/cachepot ~/.cargo ~/go smart-contracts/${{ inputs.workspace }}/**/target - key: ${{ runner.os }}-cargo-${{ inputs.workspace }}-$GITHUB_SHA - restore-keys: ${{ runner.os }}-cargo-${{ inputs.workspace }} + key: ${{ runner.os }}-cargo-test2-${{ inputs.workspace }}-$GITHUB_SHA diff --git a/.github/workflows/cargo_build_cache_osmosis.yml b/.github/workflows/cargo_build_cache_osmosis.yml index 90415d125..cd617fbb1 100644 --- a/.github/workflows/cargo_build_cache_osmosis.yml +++ b/.github/workflows/cargo_build_cache_osmosis.yml @@ -2,6 +2,7 @@ name: Store cargo build cache (osmosis) on: push: + # pull_request: branches: - main paths: diff --git a/.github/workflows/cl_vault_osmosis.yml b/.github/workflows/cl_vault_osmosis.yml index 7e584f402..80e56205f 100644 --- a/.github/workflows/cl_vault_osmosis.yml +++ b/.github/workflows/cl_vault_osmosis.yml @@ -14,6 +14,7 @@ on: push: branches: - main + - feat/cachepot-ci paths: - 'smart-contracts/osmosis/contracts/cl-vault/Cargo.toml' - 'smart-contracts/osmosis/contracts/cl-vault/**.rs' diff --git a/.github/workflows/rust_basic.yml b/.github/workflows/rust_basic.yml index 1746f3915..3b8b2bd44 100644 --- a/.github/workflows/rust_basic.yml +++ b/.github/workflows/rust_basic.yml @@ -29,15 +29,15 @@ jobs: ~/.cargo ~/go smart-contracts/${{ inputs.workspace }}/**/target - key: ${{ runner.os }}-cargo-${{ inputs.workspace }}-$GITHUB_SHA - restore-keys: ${{ runner.os }}-cargo-${{ inputs.workspace }} + key: ${{ runner.os }}-cargo-test2-${{ inputs.workspace }}-$GITHUB_SHA + restore-keys: ${{ runner.os }}-cargo-test2-${{ inputs.workspace }} - name: Rust lint - run: cargo clippy --workspace -- -D warnings --A deprecated + run: RUSTC_WRAPPER="$HOME/.cargo/bin/cachepot" cargo clippy --workspace -- -D warnings --A deprecated working-directory: smart-contracts/${{ inputs.workspace }}/${{ inputs.target }} - name: Rust format check - run: cargo fmt --all -- --check + run: RUSTC_WRAPPER="$HOME/.cargo/bin/cachepot" cargo fmt --all -- --check working-directory: smart-contracts/${{ inputs.workspace }}/${{ inputs.target }} - name: Run unit-tests if: inputs.unit_tests - run: cargo unit-test + run: RUSTC_WRAPPER="$HOME/.cargo/bin/cachepot" cargo unit-test working-directory: smart-contracts/${{ inputs.workspace }}/${{ inputs.target }}