Skip to content

Commit

Permalink
Compile contracts on CI too
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoalt committed Feb 15, 2023
1 parent 1232ea4 commit 6dfc58c
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 1,703 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,24 @@ jobs:
uses: actions/cache@v3
with:
path: circuits/
key: cache-circuits-${{ hashFiles('**/out') }}
key: cache-circuits-${{ hashFiles('**/*.zok') }}
- name: Compile circuit
if: steps.cache-circuits.outputs.cache-hit != 'true'
run: cd circuits && zokrates compile -i fusion.zok
run: cd circuits && make
- name: Compute trusted setup
if: steps.cache-circuits.outputs.cache-hit != 'true'
run: cd circuits && zokrates setup
run: cd circuits && make setup
- name: Generate Solidity verifier
if: steps.cache-circuits.outputs.cache-hit != 'true'
run: cd circuits && make verifier

build:
needs: build_circuit
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: ⚡ Cache Cargo
uses: actions/cache@v3
with:
Expand All @@ -51,11 +56,15 @@ jobs:
uses: actions/cache/restore@v3
with:
path: circuits/
key: cache-circuits-${{ hashFiles('**/out') }}
key: cache-circuits-${{ hashFiles('**/*.zok') }}
- name: Compile contracts
run: cd l1-verifier && make
- name: Format contract Rust bindings
run: cd l1-verifier/out/bindings && cargo fmt
- name: Build
run: cargo build
run: cargo build --release
- name: Run tests
run: cargo test
run: cargo test --release -- --nocapture
- name: Lint
run: cargo clippy --all --all-features -- -D warnings
- name: Format
Expand Down
1 change: 1 addition & 0 deletions circuits/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ setup:

verifier:
zokrates export-verifier
sed -i -e '204,217d' verifier.sol

clean:
rm abi.json out out.r1cs out.wtns witness verification.key proof.json verifier.sol
4 changes: 0 additions & 4 deletions fusion-sequencer/src/sequencer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ mod test {
assert_eq!(acc_2.nonce, 3.into());
}

#[ignore]
#[tokio::test(flavor = "multi_thread")]
async fn end_to_end_simple() {
let anvil_config = NodeConfig::test();
Expand Down Expand Up @@ -297,7 +296,6 @@ mod test {
assert_eq!(contract.root().call().await.unwrap(), state.root());
}

#[ignore]
#[tokio::test(flavor = "multi_thread")]
async fn deposit() {
let anvil_config = NodeConfig::test();
Expand Down Expand Up @@ -384,7 +382,6 @@ mod test {
assert_eq!(contract.root().call().await.unwrap(), state.root());
}

#[ignore]
#[tokio::test(flavor = "multi_thread")]
async fn deposit_partial_claim() {
let anvil_config = NodeConfig::test();
Expand Down Expand Up @@ -473,7 +470,6 @@ mod test {
assert_eq!(contract.root().call().await.unwrap(), state.root());
}

#[ignore]
#[tokio::test(flavor = "multi_thread")]
async fn deposit_transfer_withdraw_flow() {
let anvil_config = NodeConfig::test();
Expand Down
7 changes: 7 additions & 0 deletions l1-verifier/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
all:
cp ../circuits/verifier.sol ./src/Verifier.sol
forge clean
forge bind --select Fusion --crate-name "fusion-l1"

clean:
forge clean
9 changes: 0 additions & 9 deletions l1-verifier/out/bindings/Cargo.toml

This file was deleted.

545 changes: 0 additions & 545 deletions l1-verifier/out/bindings/src/fusion.rs

This file was deleted.

803 changes: 0 additions & 803 deletions l1-verifier/out/bindings/src/fusion_test.rs

This file was deleted.

7 changes: 0 additions & 7 deletions l1-verifier/out/bindings/src/lib.rs

This file was deleted.

Loading

0 comments on commit 6dfc58c

Please sign in to comment.