Skip to content

Commit

Permalink
feat: modularize toolchain tests (#1102)
Browse files Browse the repository at this point in the history
* feat: modularize toolchain tests

* feat: name integration tests and update layout

* feat: remove new_air_test_with_segments

* feat: add to CI

* feat: initial program lints

* feat: book examples crate

* fix: integration-tests.md
  • Loading branch information
arayikhalatyan authored Dec 18, 2024
1 parent 74f0b4f commit 56caed2
Show file tree
Hide file tree
Showing 82 changed files with 1,745 additions and 701 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/algebra-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ jobs:
working-directory: extensions/algebra/circuit
run: |
cargo nextest run --cargo-profile=fast
- name: Run algebra integration tests
working-directory: extensions/algebra/tests
run: |
rustup component add rust-src --toolchain nightly-2024-10-30
cargo nextest run --cargo-profile=fast
6 changes: 6 additions & 0 deletions .github/workflows/bigint-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ jobs:
working-directory: extensions/bigint/circuit
run: |
cargo nextest run --cargo-profile=fast
- name: Run bigint integration tests
working-directory: extensions/bigint/tests
run: |
rustup component add rust-src --toolchain nightly-2024-10-30
cargo nextest run --cargo-profile=fast
41 changes: 21 additions & 20 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- "crates/vm/**"
- "crates/sdk/**"
- "crates/cli/**"
- "examples/**"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
Expand All @@ -23,39 +24,39 @@ env:
jobs:
app-level-cli:
runs-on:
- runs-on
- run-id=${{ github.run_id }}
- family=m7
- runs-on=${{ github.run_id }}
- runner=32cpu-linux-arm64

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: taiki-e/install-action@nextest
- name: Install solc # svm should support arm64 linux
run: (hash svm 2>/dev/null || cargo install --version 0.2.23 svm-rs) && svm install 0.8.19 && solc --version

- name: Install architecture specific tools
- name: Install tools
run: |
arch=$(uname -m)
case $arch in
arm64|aarch64)
rustup component add rust-src --toolchain nightly-2024-10-30-aarch64-unknown-linux-gnu
;;
x86_64|amd64)
rustup component add rust-src --toolchain nightly-2024-10-30-x86_64-unknown-linux-gnu
;;
*)
echo "Unsupported architecture: $arch"
exit 1
;;
esac
rustup component add rust-src --toolchain nightly-2024-10-30
- name: Setup halo2
- name: Install cargo-openvm
working-directory: crates/cli
run: |
cargo install --force --locked --path .
- name: Build book examples
working-directory: examples
run: |
bash ./extensions/native/recursion/trusted_setup_s3.sh
for dir in */; do
if [ -f "${dir}Cargo.toml" ]; then
echo "Building ${dir%/}"
cd "$dir"
cargo openvm build
cd ..
fi
done
# TODO: CLI build, transpile, run, (keygen), prove, contract, verify
- name: Run app-level CLI commands
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/ecc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,25 @@ jobs:
run: |
RUST_MIN_STACK=8388608 cargo nextest run --cargo-profile=fast
- name: Run pairing integration tests
working-directory: extensions/pairing/tests
run: |
rustup component add rust-src --toolchain nightly-2024-10-30
RUST_MIN_STACK=8388608 cargo nextest run --cargo-profile=fast
- name: Install cargo-openvm
working-directory: crates/cli
run: |
rustup component add rust-src --toolchain nightly-2024-10-30-aarch64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-10-30
cargo install --force --locked --path .
- name: Build openvm-ecc-guest crate for openvm
working-directory: extensions/ecc/guest
run: |
cargo openvm build --no-transpile
- name: Run ecc integration tests
working-directory: extensions/ecc/tests
run: |
rustup component add rust-src --toolchain nightly-2024-10-30
cargo nextest run --cargo-profile=fast
6 changes: 6 additions & 0 deletions .github/workflows/keccak256-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ jobs:
working-directory: extensions/keccak256/circuit
run: |
cargo nextest run --cargo-profile=fast
- name: Run keccak256 integration tests
working-directory: extensions/keccak256/tests
run: |
rustup component add rust-src --toolchain nightly-2024-10-30
cargo nextest run --cargo-profile=fast
2 changes: 1 addition & 1 deletion .github/workflows/riscv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ jobs:
- name: Run RISC-V test vector tests
working-directory: crates/toolchain/tests
run: |
rustup component add rust-src --toolchain nightly-2024-10-30-aarch64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-10-30
cargo nextest run --cargo-profile=fast --run-ignored only -- test_rv32im_riscv_vector_runtime
6 changes: 6 additions & 0 deletions .github/workflows/rv32im-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ jobs:
working-directory: extensions/rv32im/circuit
run: |
cargo nextest run --cargo-profile=fast
- name: Run rv32im integration tests
working-directory: extensions/rv32im/tests
run: |
rustup component add rust-src --toolchain nightly-2024-10-30
cargo nextest run --cargo-profile=fast
6 changes: 0 additions & 6 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,3 @@ jobs:
with:
cache-on-failure: true
- uses: taiki-e/install-action@nextest

- name: Run toolchain tests
working-directory: crates/toolchain/tests
run: |
rustup component add rust-src --toolchain nightly-2024-10-30-aarch64-unknown-linux-gnu
RUST_MIN_STACK=8388608 cargo nextest run --cargo-profile=fast
127 changes: 127 additions & 0 deletions Cargo.lock

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

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ members = [
"extensions/algebra/transpiler",
"extensions/algebra/guest",
"extensions/algebra/moduli-setup",
"extensions/algebra/tests",
"extensions/bigint/circuit",
"extensions/bigint/transpiler",
"extensions/bigint/guest",
"extensions/bigint/tests",
"extensions/keccak256/circuit",
"extensions/keccak256/transpiler",
"extensions/keccak256/guest",
"extensions/keccak256/tests",
"extensions/native/circuit",
"extensions/native/compiler",
"extensions/native/compiler/derive",
Expand All @@ -46,10 +49,13 @@ members = [
"extensions/ecc/transpiler",
"extensions/ecc/guest",
"extensions/ecc/sw-setup",
"extensions/ecc/tests",
"extensions/pairing/circuit",
"extensions/pairing/transpiler",
"extensions/pairing/guest",
"extensions/pairing/tests",
"extensions/rv32-adapters",
"extensions/rv32im/tests",
]
exclude = ["crates/sdk/example"]
resolver = "2"
Expand Down
10 changes: 0 additions & 10 deletions crates/toolchain/tests/programs/.cargo/config.toml

This file was deleted.

6 changes: 0 additions & 6 deletions crates/toolchain/tests/programs/examples/empty.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ To disassemble the ELF to read the instructions, [install cargo-binutils](https:
rust-objdump -d target/riscv32im-risc0-zkvm-elf/debug/examples/openvm-fibonacci-program
```

where `-d` is short for `--disassemble`.
where `-d` is short for `--disassemble`.
Loading

0 comments on commit 56caed2

Please sign in to comment.