Skip to content

Extend Poseidon2 Chip for MULTI_OBSERVE #21

Extend Poseidon2 Chip for MULTI_OBSERVE

Extend Poseidon2 Chip for MULTI_OBSERVE #21

Workflow file for this run

name: Lint Workspace
on:
push:
branches: ["main"]
pull_request:
branches: ["**"]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on:
- runs-on=${{ github.run_id }}
- runner=64cpu-linux-x64
- extras=s3-cache
steps:
- uses: runs-on/action@v1
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@v2
with:
skip: Cargo.lock,./book/pnpm-lock.yaml,*.txt,./crates/toolchain/openvm/src/memcpy.s,./crates/toolchain/openvm/src/memset.s,./audits/*.pdf,./guest-libs/ruint/*
ignore_words_file: .codespellignore
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Generate docs
run: |
cargo doc --workspace --exclude "openvm-benchmarks" --exclude "*-tests" --exclude "*-test"
- name: Run fmt
run: |
rustup install nightly
rustup component add --toolchain nightly rustfmt
cargo +nightly fmt --all -- --check
- name: Run clippy
run: |
# list of all unique features across workspace generated using:
# cargo metadata --format-version=1 --no-deps | jq -r '.packages[].features | to_entries[] | .key' | sort -u | tr '\n' ' ' && echo ""
# (exclude mimalloc since it conflicts with jemalloc)
cargo clippy --all-targets --all --tests --features "aggregation bench-metrics bls12_381 bn254 build-binaries default entrypoint evm-prove evm-verify export-intrinsics export-libm function-span getrandom-unsupported halo2-compiler halo2curves heap-embedded-alloc jemalloc jemalloc-prof nightly-features panic-handler parallel profiling rust-runtime static-verifier std test-utils" -- -D warnings
cargo clippy --all-targets --all --tests --no-default-features --features "mimalloc" -- -D warnings
- name: Run fmt, clippy for guest
run: |
# Find all directories named "programs" and include additional static paths
for crate_path in $(find . -type d -name "programs" -exec find {} -mindepth 0 -maxdepth 0 -type d \;) examples/*; do
# Check if Cargo.toml exists in the directory
if [ -f "$crate_path/Cargo.toml" ]; then
echo "Running cargo fmt, clippy for $crate_path"
cargo +nightly fmt --manifest-path "$crate_path/Cargo.toml" --all -- --check
if [[ "$crate_path" == *"guest-libs/pairing/tests/programs"* ]]; then
echo "Running cargo clippy with openvm_pairing_guest::bn254 feature for $crate_path"
cargo clippy --manifest-path "$crate_path/Cargo.toml" --all-targets --features "std bn254" -- -D warnings
echo "Running cargo clippy with openvm_pairing_guest::bls12_381 feature for $crate_path"
cargo clippy --manifest-path "$crate_path/Cargo.toml" --all-targets --features "std bls12_381" -- -D warnings
elif [[ "$crate_path" == *"extensions/"* || "$crate_path" == *"guest-libs/"* ]]; then
echo "Running cargo clippy with std feature for $crate_path"
cargo clippy --manifest-path "$crate_path/Cargo.toml" --all-targets --features "std" -- -D warnings
else
echo "Running cargo clippy for $crate_path"
cargo clippy --manifest-path "$crate_path/Cargo.toml" --all-targets -- -D warnings
fi
else
echo "Skipping $crate_path as it does not contain a Cargo.toml"
fi
done
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Cargo shear
run: |
cargo binstall --no-confirm --force cargo-shear --version 1.1.9
cargo shear
- name: Cargo audit
run: |
cargo binstall --no-confirm --force cargo-audit
cargo audit