Skip to content

Add Continuous Benchmarking to CI #1133

Add Continuous Benchmarking to CI

Add Continuous Benchmarking to CI #1133

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
push:
branches:
- main
jobs:
check-fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- run: cargo fmt --all --check
- run: cd nova-benches && cargo fmt --check
check-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
target: riscv32i-unknown-none-elf
- run: cargo check --all-features
- run: cargo check --all-features --examples
- run: cargo check -p example --target=riscv32i-unknown-none-elf
- run: cd nova-benches && cargo check --benches
cargo-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- run: cargo clippy --all-targets --all-features
test:
needs: check-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- run: cargo test -r --all-features
test-smoke:
needs: check-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup target add riscv32i-unknown-none-elf
- run: assets/scripts/smoke.sh examples/src/bin/fib3_profiling.rs
- run: assets/scripts/smoke.sh examples/src/bin/hello.rs
test-sdk:
needs: check-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup target add riscv32i-unknown-none-elf
- run: assets/scripts/test_sdk.sh examples/src/bin/hello.rs
detect-unused-crate:
runs-on: ubuntu-latest
steps:
- uses: bnjbvr/cargo-machete@main
bench-riscv:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'benchmark') || github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Install valgrind
run: sudo apt-get install -y valgrind
- name: Install iai-callgrind-runner
run: |
version=$(cargo metadata --format-version=1 |\
jq '.packages[] | select(.name == "iai-callgrind").version' |\
tr -d '"'
)
cargo install iai-callgrind-runner --version $version
- uses: bencherdev/bencher@main
- name: Run benchmarks with Bencher
run: |
bencher run \
--project bench-risc-v-trace \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch '${{ github.head_ref || github.ref_name }}' \
--testbed ubuntu-latest \
--adapter rust_iai_callgrind \
--err \
cargo bench --bench riscv_machine
bench-nova-public-params:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'benchmark') || github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: Run benchmarks
run: |
cd nova-benches/
bencher run \
--project bench-nova-public-parameter \
--token '${{ secrets.BENCHER_API_TOKEN }}' \
--branch '${{ github.head_ref || github.ref_name }}' \
--testbed ubuntu-latest \
--adapter rust_iai_callgrind \
--err \
cargo bench --bench nova_public_parameter_generation