Skip to content

CI e2e test

CI e2e test #65

Workflow file for this run

name: CI Checks
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
cargo-test:
name: cargo test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo test
run: cargo test --workspace --all-features
cargo-check:
name: cargo check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo check
run: cargo check --workspace --all-features
cargo-fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo fmt
run: cargo fmt -- --check
cargo-fix:
name: cargo fix
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo fix --workspace
run: |
# Run cargo fix on the project
cargo fix --workspace --all-features
# Check for local git changes
if ! git diff --exit-code; then
echo "There are local changes after running 'cargo fix --workspace' ❌"
exit 1
else
echo "No changes detected after running 'cargo fix --workspace' ✅"
fi
cargo-clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: cargo clippy
run: cargo clippy --workspace --all-features -- -D warnings
cargo-audit:
name: cargo audit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Rust Toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- name: install cargo-audit
run: cargo install cargo-audit
- name: cargo audit
run: cargo audit
fibonacci-square:
name: Test fibonacci square
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check out pil2-compiler
uses: actions/checkout@v3
with:
repository: 0xPolygonHermez/pil2-compiler
token: ${{ secrets.GITHUB_TOKEN }}
ref: develop
path: pil2-compiler
- name: Install pil2-compiler dependencies
working-directory: pil2-compiler
run: npm install
- name: Install gRPC dependencies
run: |
sudo apt-get update
sudo apt-get install libgrpc++-dev libnlohmann-json-dev
- name: Check out zkevm-prover
uses: actions/checkout@v3
with:
repository: 0xPolygonHermez/zkevm-prover
token: ${{ secrets.GITHUB_TOKEN }}
ref: develop_rust_lib
path: zkevm-prover
- name: Install zkevm-prover
working-directory: zkevm-prover
run: |
git submodule init
git submodule update
make clean
make starks_lib -j
make -j bctree
- name: Check out pil2-proofman-js
uses: actions/checkout@v3
with:
repository: 0xPolygonHermez/pil2-proofman-js
token: ${{ secrets.GITHUB_TOKEN }}
ref: feature/setup
path: pil2-proofman-js
- name: Install pil2-proofman-js dependencies
working-directory: pil2-proofman-js
run: npm install
- name: Check out pil2-components
uses: actions/checkout@v3
with:
repository: 0xPolygonHermez/pil2-components
token: ${{ secrets.GITHUB_TOKEN }}
ref: fix/dependencies_proofman
path: pil2-components
- name: Install pil2-components dependencies
working-directory: pil2-components
run: npm install
- name: Compile PIL
run: |
node ../pil2-compiler/src/pil.js ../pil2-components/test/fibonacci/pil/build.pil -I ../pil2-components/lib/std/pil -o ./examples/fibonacci-square/pil/build.pilout
- name: Generate setup
run: |
node ../pil2-proofman-js/src/main_setup.js -a ./examples/fibonacci-square/pil/build.pilout -b ./examples/fibonacci-square/build
- name: Generate PIL Helpers
run: |
cargo run --bin proofman-cli pil-helpers --pilout ./examples/fibonacci-square/pil/build.pilout --path ./examples/fibonacci-square/src -o
- name: Modify Cargo.toml
run: |
sed -i 's/# examples\/fibonacci-square/examples\/fibonacci-square/g' ./Cargo.toml
- name: Modify stark-prover-lib
run: |
sed -i 's/default = \["no_lib_link"\]/default = \[\]/g' ./provers/starks-lib-c/Cargo.toml
- name: Cargo build
run: cargo build
- name: Verify constraints
run: |
cargo run --bin proofman-cli verify-constraints --witness-lib ./target/debug/libfibonacci_square.so --proving-key examples/fibonacci-square/build/provingKey/ --public-inputs examples/fibonacci-square/src/inputs.json
- name: Generate proof
run: |
cargo run --bin proofman-cli prove --witness-lib ./target/debug/libfibonacci_square.so --proving-key examples/fibonacci-square/build/provingKey/ --public-inputs examples/fibonacci-square/src/inputs.json --output-dir examples/fibonacci-square/build/proofs
- name: Verify proof
run: |
node ../pil2-proofman-js/src/main_verify -k examples/fibonacci-square/build -p examples/fibonacci-square/build/proofs