Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
ci(offchain): reduce cache size by using cargo sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
gligneul committed Jun 26, 2023
1 parent ef2b114 commit 6d040ba
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ jobs:
with:
submodules: recursive
token: ${{ secrets.CI_TOKEN }}

- name: 📦 Install protoc
run: sudo apt update && sudo apt install -y protobuf-compiler libprotobuf-dev

- uses: actions/cache@v3
with:
path: |
Expand All @@ -39,11 +41,31 @@ jobs:
offchain/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- run: cargo install diesel_cli --no-default-features --features "postgres" --force
- run: cargo fmt --all -- --check
- run: cargo check --workspace
- run: cargo test --no-run
- run: cargo test

- name: Install diesel
run: cargo install diesel_cli --no-default-features --features "postgres" --force

- name: Install cargo sweep
run: cargo install cargo-sweep
continue-on-error: true

- name: Check format
run: cargo fmt --all -- --check

- name: Set sweep timestamp
run: cargo sweep -s

- name: Check code
run: cargo check --workspace

- name: Build binaries and tests
run: cargo test --no-run

- name: Clean old build files
run: cargo sweep -f

- name: Run tests
run: cargo test

test_onchain:
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 6d040ba

Please sign in to comment.