Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci build with cache #96

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
name: Build
on: [push]
on:
push:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up cache for Foundry
uses: actions/cache@v3
with:
path: ~/.foundry
key: ${{ runner.os }}-foundry-${{ hashFiles('**/foundry.toml') }}
restore-keys: |
${{ runner.os }}-foundry-

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
Expand All @@ -18,3 +28,34 @@ jobs:
forge build
forge fmt --check
forge test

- name: Set up cache for Cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Install just
uses: extractions/setup-just@v2

- name: Deps
run: |
export CARTESI_MACHINE_VERSION=0.18.1
sudo apt-get install -y libboost-all-dev lua5.4 libslirp0
wget https://github.com/cartesi/machine-emulator/releases/download/v0.18.1/cartesi-machine-v${CARTESI_MACHINE_VERSION}_amd64.deb
sudo dpkg -i ./cartesi-machine-v${CARTESI_MACHINE_VERSION}_amd64.deb
rm ./cartesi-machine-v${CARTESI_MACHINE_VERSION}_amd64.deb

- name: Rust fmt and check
run: |
just setup
just format-rust-workspace
just check-rust-workspace

- name: Rust test workspace
run: |
just test-rust-workspace