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 71b23c1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 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-test3-${{ inputs.workspace }}-${{github.sha}}
11 changes: 6 additions & 5 deletions .github/workflows/cargo_build_cache_osmosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
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
11 changes: 6 additions & 5 deletions .github/workflows/rust_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 71b23c1

Please sign in to comment.