fix: optimize opening proof gpu usage #1223
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test Jolt | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: ['**', main] | ||
env: | ||
RUSTFLAGS: -D warnings | ||
CARGO_TERM_COLOR: always | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
jobs: | ||
build-docker: | ||
name: Build Docker Image | ||
runs-on: ubuntu-latest | ||
outputs: | ||
docker_image: ${{ steps.build.outputs.docker_image }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Build Docker Image | ||
id: build | ||
run: | | ||
docker build -t custom-cuda-image:latest -f .github/workflows/Dockerfile . | ||
echo "docker_image=custom-cuda-image:latest" >> $GITHUB_ENV | ||
fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: rustfmt | ||
- name: cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all --check | ||
- name: cargo fmt with icicle | ||
needs: build-docker | ||
run: | | ||
docker run --rm \ | ||
-v ${{ github.workspace }}:/workspace \ | ||
-w /workspace \ | ||
custom-cuda-image:latest \ | ||
cargo fmt --all --check --features icicle | ||
clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: clippy | ||
- name: cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: --all | ||
machete: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: bnjbvr/cargo-machete@main | ||
- name: cargo machete | ||
run: cargo machete --with-metadata | ||
build-wasm: | ||
name: Build Wasm | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Install wasm32 target | ||
run: rustup target add wasm32-unknown-unknown | ||
- name: Build Wasm | ||
working-directory: ./jolt-core | ||
run: cargo build --release --target wasm32-unknown-unknown | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Cache Jolt RISC-V Rust toolchain | ||
uses: actions/cache@v4 | ||
with: | ||
key: jolt-rust-toolchain-${{hashFiles('guest-toolchain-tag')}} | ||
path: ~/.jolt | ||
- name: Install Jolt RISC-V Rust toolchain | ||
run: cargo run install-toolchain | ||
- name: Install nextest | ||
uses: taiki-e/install-action@nextest | ||
- name: Run jolt-core tests | ||
run: cargo nextest run --release -p jolt-core | ||
# Run jolt-core tests with icicle feature | ||
- name: Run jolt-core tests with --features icicle | ||
run: | | ||
docker run --rm \ | ||
-v ${{ github.workspace }}:/workspace \ | ||
-w /workspace \ | ||
custom-cuda-image:latest \ | ||
cargo nextest run --release -p jolt-core --features icicle | ||
on-chain: | ||
name: Onchain Verifier Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
- name: Build the rust integration testing scripts | ||
working-directory: ./jolt-evm-verifier | ||
run: cargo build --manifest-path script/Cargo.toml --release | ||
- name: Check build and denny warnings | ||
working-directory: ./jolt-evm-verifier | ||
run: forge build --deny-warnings | ||
- name: Run tests | ||
working-directory: ./jolt-evm-verifier | ||
run: forge test -vvv --via-ir --ffi | ||
- name: Check Format | ||
working-directory: ./jolt-evm-verifier | ||
run: forge fmt --check |