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

refactor: refactor build and tests pipeline #94

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
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
86 changes: 80 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,80 @@
.vscode
/**/target/
/**/snapshots/
Cargo.lock
/**/compute_data/
/**/rollups_data/
**/.git
**/.github
**/.venv
**/.vscode
**/.DS_Store

**/target/

**/_state/
**/snapshots/
**/compute_data/
**/rollups_data/

**/out/
**/cache/

test/programs/linux.bin
test/programs/rootfs.ext2
test/programs/**/machine-image/
test/programs/**/addresses
test/programs/**/anvil_state.json
test/programs/**/_anvil.log

cartesi-rollups/contracts/bindings-rs/src/contract/
prt/contracts/bindings-rs/src/contract/

prt/tests/compute/outputs/
prt/tests/compute/pixels/

machine/emulator/**/*.o
machine/emulator/**/*.swp
machine/emulator/**/*.d
machine/emulator/**/*.pb.cc
machine/emulator/**/*.pb.h
machine/emulator/**/*.gcno
machine/emulator/**/*.so
machine/emulator/**/*.dtb
machine/emulator/**/*.bin
machine/emulator/**/*.md
machine/emulator/**/*.deb

machine/emulator/src/*.pb.h
machine/emulator/src/*.pb.cc
machine/emulator/src/*.ext2
machine/emulator/src/*.bin
machine/emulator/src/*.gcno
machine/emulator/src/*.gcov
machine/emulator/src/*.gcda
machine/emulator/src/*.profraw
machine/emulator/src/compile_flags.txt
machine/emulator/src/coverage*
machine/emulator/src/jsonrpc-discover.cpp
machine/emulator/src/machine-c-version.h

machine/emulator/build
machine/emulator/third-party/downloads
machine/emulator/src/cartesi-machine-client
machine/emulator/src/cartesi-machine-server
machine/emulator/src/cartesi-machine-hash
machine/emulator/doc/

machine/emulator/**/*.clang-tidy
machine/emulator/**/*.a
machine/emulator/**/*.lib
machine/emulator/**/*.wasm
machine/emulator/**/*.tar.gz
machine/emulator/**/*.raw
machine/emulator/**/*.so
machine/emulator/**/*.dll
machine/emulator/**/*.exe
machine/emulator/**/*.dylib
machine/emulator/**/*.dtb
machine/emulator/**/*.tmp
machine/emulator/**/*.ld
machine/emulator/**/*.elf
machine/emulator/**/*.bin

machine/emulator/uarch/uarch-pristine-hash.c
machine/emulator/uarch/uarch-pristine-ram.c
machine/emulator/uarch/compute-uarch-pristine-hash
File renamed without changes
53 changes: 49 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,65 @@
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:
version: nightly

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

- name: Build, format check and test
working-directory: ./prt/contracts
run: |
forge build
forge fmt --check
forge test
just check-fmt
just build-smart-contracts
just 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: 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 check-fmt-rust-workspace
just check-rust-workspace

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

- name: Rust test workspace
run: |
just test-rust-workspace
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
.bin
.env
.vscode
.DS_Store
**/.DS_Store
**/.idea/
target/
snapshots/
common-rs/Cargo.lock
prt/client-rs/Cargo.lock
prt/tests/compute/outputs/
prt/tests/compute/pixels/
node_modules
**/contract-bindings/src/contract
**/contract-bindings/Cargo.lock
**/snapshots/
**/compute_data/
**/rollups_data/
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Gabriel Coutinho de Paula <[email protected]>
Guilherme Dantas <[email protected]>
Stephen Chen <[email protected]>
Loading