Skip to content

Commit

Permalink
Add cachepot to pre-commit verification
Browse files Browse the repository at this point in the history
  • Loading branch information
lubkoll committed Aug 21, 2024
1 parent ae05eb4 commit 36befcb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/cargo_build_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-test-${{ inputs.workspace }}-$GITHUB_SHA
1 change: 1 addition & 0 deletions .github/workflows/cl_vault_osmosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/rust_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-test-${{ inputs.workspace }}-$GITHUB_SHA
restore-keys: ${{ runner.os }}-cargo-test-${{ 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 }}

0 comments on commit 36befcb

Please sign in to comment.