Skip to content

Commit

Permalink
chore: add Rust build cache in CI (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael1011 authored Jan 8, 2025
1 parent 3ed922d commit 50cb625
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1

- name: Use Rust toolchain
run: rustup update ${{ matrix.rust-version }} && rustup default ${{ matrix.rust-version }}
run:
rustup update ${{ matrix.rust-version }} && rustup default ${{
matrix.rust-version }}

- name: Install build dependencies
run: sudo apt-get update && sudo apt-get -y install protobuf-compiler
Expand All @@ -45,6 +47,18 @@ jobs:
- name: Deploy Ethereum contracts
run: npm run docker:solidity:deploy

- name: Build cache
uses: actions/cache@v4
with:
path: |
hold/target
boltzr/target
key:
${{ runner.os }}-ci-${{ matrix.rust-version }}-${{
hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-ci-${{ matrix.rust-version }}-
- name: Compile
run: npm run compile

Expand Down Expand Up @@ -90,7 +104,9 @@ jobs:
cache: 'npm'

- name: Use Rust toolchain
run: rustup update ${{ matrix.rust-version }} && rustup default ${{ matrix.rust-version }}
run:
rustup update ${{ matrix.rust-version }} && rustup default ${{
matrix.rust-version }}

- name: Install rustfmt
run: rustup component add rustfmt
Expand All @@ -113,6 +129,16 @@ jobs:
- name: Deploy Ethereum contracts
run: npm run docker:solidity:deploy

- name: Build cache
uses: actions/cache@v4
with:
path: boltzr/target
key:
${{ runner.os }}-cargo-${{ matrix.rust-version }}-${{
hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.rust-version }}-
- name: Compile
run: cargo build

Expand Down

0 comments on commit 50cb625

Please sign in to comment.