diff --git a/.github/workflows/cargo_build_cache.yml b/.github/workflows/cargo_build_cache.yml index 3076a3a62..a89440976 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-test3-${{ inputs.workspace }}-${{github.sha}} diff --git a/.github/workflows/cargo_build_cache_osmosis.yml b/.github/workflows/cargo_build_cache_osmosis.yml index 90415d125..71416789b 100644 --- a/.github/workflows/cargo_build_cache_osmosis.yml +++ b/.github/workflows/cargo_build_cache_osmosis.yml @@ -2,11 +2,12 @@ name: Store cargo build cache (osmosis) on: push: - branches: - - main - paths: - - 'smart-contracts/osmosis/**.rs' - - 'smart-contracts/osmosis/**.toml' + pull_request: + # branches: + # - main + # paths: + # - 'smart-contracts/osmosis/**.rs' + # - 'smart-contracts/osmosis/**.toml' workflow_dispatch: jobs: 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..5b7133633 100644 --- a/.github/workflows/rust_basic.yml +++ b/.github/workflows/rust_basic.yml @@ -26,18 +26,19 @@ jobs: uses: actions/cache/restore@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-test3-${{ inputs.workspace }}-${{github.sha}} + restore-keys: ${{ runner.os }}-cargo-test3-${{ 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 }}