Skip to content

Commit

Permalink
add integration test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Sep 11, 2024
1 parent 101da51 commit 7774b8d
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 11 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Integrations

on:
merge_group:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
push:
branches:
- master

jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
concurrent_skipping: 'same_content_newer'
paths_ignore: '["**/README.md"]'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule", "merge_group"]'

lints:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: Various lints
timeout-minutes: 30
runs-on: ubuntu-latest

strategy:
matrix:
target: [x86_64-unknown-linux-gnu, riscv32im-unknown-none-elf]
# Exclude the riscv32im-unknown-none-elf target
exclude:
- target: riscv32im-unknown-none-elf

steps:
- uses: actions/checkout@v2
- name: Cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: integration-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Run example
uses: actions-rs/cargo@v1
with:
command: run
args: --package ceno_zkvm --example riscv_add --target ${{ matrix.target }} -- --start 10 --end 11

1 change: 0 additions & 1 deletion .github/workflows/lints.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Lints

# We only run these lints on trial-merges of PRs to reduce noise.
on:
merge_group:
pull_request:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Tests

# We only run these lints on trial-merges of PRs to reduce noise.
on:
merge_group:
pull_request:
Expand Down
105 changes: 97 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ceno_zkvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tracing = "0.1.40"

rand = "0.8"
thread_local = "1.1.8"
clap = { version = "4.5.17", features = ["derive"] }

[dev-dependencies]
pprof = { version = "0.13", features = ["flamegraph"]}
Expand Down
17 changes: 16 additions & 1 deletion ceno_zkvm/examples/riscv_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::time::Instant;

use ark_std::test_rng;
use ceno_zkvm::{instructions::riscv::addsub::AddInstruction, scheme::prover::ZKVMProver};
use clap::Parser;
use const_env::from_env;

use ceno_emul::{ByteAddr, InsnKind::ADD, StepRecord, VMState, CENO_PLATFORM};
Expand Down Expand Up @@ -34,7 +35,21 @@ const PROGRAM_ADD_LOOP: [u32; 4] = [
0b_000000000000_00000_000_00000_1110011, // ecall halt
];

/// Simple program to greet a person
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {
/// start round
#[arg(short, long, default_value_t = 8)]
start: u8,

/// end round
#[arg(short, long, default_value_t = 22)]
end: u8,
}

fn main() {
let args = Args::parse();
type E = GoldilocksExt2;

let max_threads = {
Expand Down Expand Up @@ -90,7 +105,7 @@ fn main() {
let prover = ZKVMProver::new(pk);
let verifier = ZKVMVerifier::new(vk);

for instance_num_vars in 8..22 {
for instance_num_vars in args.start..args.end {
let num_instances = 1 << instance_num_vars;
let mut vm = VMState::new(CENO_PLATFORM);
let pc_start = ByteAddr(CENO_PLATFORM.pc_start()).waddr();
Expand Down

0 comments on commit 7774b8d

Please sign in to comment.