chore: fix some typos in comments #6291
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: CI | |
on: | |
merge_group: | |
pull_request: | |
branches: [main, "release-*"] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
# this is needed to gain access via OIDC to the S3 bucket for caching | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RISC0_TOOLCHAIN_VERSION: v2024-02-08.1 | |
defaults: | |
run: | |
# This ensures `-eo pipefail`, which is important for catching errors | |
shell: bash | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
check-benchmarks: ${{ steps.filter.outputs.check-benchmarks }} | |
check-external: ${{ steps.filter.outputs.check-external }} | |
check-semver: ${{ steps.filter.outputs.check-semver }} | |
check-template: ${{ steps.filter.outputs.check-template }} | |
crates-validator: ${{ steps.filter.outputs.crates-validator }} | |
doc: ${{ steps.filter.outputs.doc }} | |
examples: ${{ steps.filter.outputs.examples }} | |
stark2snark: ${{ steps.filter.outputs.stark2snark }} | |
test: ${{ steps.filter.outputs.test }} | |
web: ${{ steps.filter.outputs.web }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: risc0/paths-filter@4067d885736b84de7c414f582ac45897079b0a78 | |
id: filter | |
with: | |
filters: | | |
base: &base | |
- .github/actions/** | |
- .github/workflows/main.yml | |
- Cargo.toml | |
- rust-toolchain.toml | |
- Cargo.lock | |
check-benchmarks: | |
- *base | |
- benchmarks/** | |
- risc0/** | |
check-external: | |
- *base | |
- external/** | |
- risc0/** | |
check-semver: | |
- *base | |
- risc0/** | |
check-template: | |
- *base | |
- risc0/** | |
- templates/** | |
crates-validator: | |
- *base | |
- tools/crates-validator/** | |
doc: | |
- *base | |
- bonsai/sdk/** | |
- risc0/** | |
examples: | |
- *base | |
- examples/** | |
- risc0/** | |
stark2snark: | |
- *base | |
- compact_proof/** | |
- risc0/** | |
test: | |
- *base | |
- bonsai/sdk/** | |
- external/** | |
- risc0/** | |
web: | |
- *base | |
- examples/browser-verify/** | |
- risc0/** | |
- xtask/** | |
# see: https://github.com/orgs/community/discussions/26822 | |
main-status-check: | |
if: always() | |
needs: | |
- check | |
- check-benchmarks | |
- check-external | |
- check-semver | |
- check-template | |
- crates-validator | |
- doc | |
- examples | |
- reproducible-build | |
- stark2snark | |
- test | |
- web | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check all job status | |
# see https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context | |
# see https://stackoverflow.com/a/67532120/4907315 | |
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
run: exit 1 | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Full history is required by license-check.py | |
fetch-depth: 0 | |
- uses: ./.github/actions/rustup | |
- name: Install cargo-sort | |
uses: risc0/cargo-install@b9307573043522ab0d3e3be64a51763b765b52a4 | |
with: | |
crate: cargo-sort | |
version: "1.0" | |
- name: Install cargo-rdme | |
uses: risc0/cargo-install@b9307573043522ab0d3e3be64a51763b765b52a4 | |
with: | |
crate: cargo-rdme | |
version: "1.4.2" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: cargo fmt --all --check | |
- run: cargo fmt --all --check --manifest-path benchmarks/Cargo.toml | |
- run: cargo fmt --all --check --manifest-path bonsai/Cargo.toml | |
- run: cargo fmt --all --check --manifest-path examples/Cargo.toml | |
- run: cargo fmt --all --check --manifest-path tools/crates-validator/Cargo.toml | |
- run: cargo clippy -p risc0-zkvm | |
- run: cargo sort --workspace --check | |
- run: cargo sort --workspace --check benchmarks | |
- run: cargo sort --workspace --check bonsai | |
- run: cargo sort --workspace --check examples | |
- run: cargo sort --workspace --check tools/crates-validator | |
- run: cargo rdme -c | |
working-directory: bonsai/sdk | |
- run: cargo rdme -c | |
working-directory: risc0/zkvm | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- run: python license-check.py | |
- name: check for "D0 NOT MERGE" comments | |
run: | | |
[ "$(grep -re 'DO[_ ]\?NOT[_ ]\?MERGE' $(git ls-tree --full-tree --name-only -r HEAD) | tee /dev/fd/2 | wc -l)" -eq "0" ] | |
- name: Compare circom hashes to golden values | |
run: bash ./.github/scripts/circom_stable.sh | |
test: | |
if: needs.changes.outputs.test == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, "${{ matrix.os }}", "${{ matrix.device }}"] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [Linux, macOS] | |
feature: [default] | |
device: [cpu] | |
include: | |
- os: Linux | |
feature: cuda | |
device: nvidia_rtx_a5000 | |
- os: macOS | |
feature: metal | |
device: apple_m2_pro | |
env: | |
FEATURE: ${{ matrix.feature }} | |
RISC0_BUILD_LOCKED: 1 | |
RUST_BACKTRACE: full | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v4 | |
- if: matrix.feature == 'cuda' | |
uses: ./.github/actions/cuda | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: ${{ matrix.os }}-${{ matrix.feature }} | |
- run: cargo run --bin cargo-risczero --no-default-features -- risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- name: build workspace | |
run: | | |
cargo test -F $FEATURE -F prove --workspace --timings --no-run \ | |
--exclude doc-test \ | |
--exclude bonsai-rest-api-mock | |
- name: test workspace | |
run: | | |
cargo test -F $FEATURE -F prove --workspace --timings \ | |
--exclude doc-test \ | |
--exclude bonsai-rest-api-mock | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: cargo-timings-${{ matrix.os }}-${{ matrix.device }} | |
path: target/cargo-timings/ | |
retention-days: 5 | |
- name: build risc0-r0vm | |
run: cargo test -p risc0-r0vm -F $FEATURE -F disable-dev-mode --no-run | |
- name: test risc0-r0vm | |
run: cargo test -p risc0-r0vm -F $FEATURE -F disable-dev-mode | |
- run: cargo test -p cargo-risczero -F experimental | |
if: matrix.device == 'cpu' | |
- run: | | |
cargo check -F $FEATURE --benches --workspace \ | |
--exclude doc-test \ | |
--exclude bonsai-rest-api-mock | |
- run: cargo check -p risc0-build | |
if: matrix.device == 'cpu' | |
- run: cargo check -p risc0-circuit-rv32im -F $FEATURE | |
- run: cargo check -p risc0-core | |
if: matrix.device == 'cpu' | |
- run: cargo check -p risc0-sys -F $FEATURE | |
- run: cargo check -p risc0-zkp -F $FEATURE | |
- run: cargo check -p risc0-zkvm -F $FEATURE | |
- run: sccache --show-stats | |
examples: | |
if: needs.changes.outputs.examples == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, "${{ matrix.os }}", "${{ matrix.device }}"] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [Linux, macOS] | |
feature: [default] | |
device: [cpu] | |
include: | |
- os: Linux | |
feature: cuda | |
device: nvidia_rtx_a5000 | |
- os: macOS | |
feature: metal | |
device: apple_m2_pro | |
env: | |
FEATURE: ${{ matrix.feature }} | |
RISC0_BUILD_LOCKED: 1 | |
RISC0_EXECUTOR: ipc | |
RISC0_PROVER: ipc | |
RISC0_SERVER_PATH: ${{ github.workspace }}/target/release/r0vm | |
RUST_BACKTRACE: full | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v4 | |
- if: matrix.feature == 'cuda' | |
uses: ./.github/actions/cuda | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: ${{ matrix.os }}-${{ matrix.feature }} | |
- run: cargo run --bin cargo-risczero --no-default-features -- risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- run: cargo build --release -p risc0-r0vm -F $FEATURE | |
- name: build | |
run: cargo test --locked -F $FEATURE --no-run | |
working-directory: examples | |
- name: test | |
run: RISC0_DEV_MODE=1 cargo test --locked -F $FEATURE | |
working-directory: examples | |
- run: cargo run --locked -F $FEATURE | |
env: | |
RISC0_PPROF_OUT: ${{ github.workspace }}/fibonacci.pb | |
working-directory: examples/profiling | |
- run: sccache --show-stats | |
doc: | |
if: needs.changes.outputs.doc == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, macOS, cpu] | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: macOS-default | |
- run: cargo run --bin cargo-risczero --no-default-features -- risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- run: cargo doc --no-deps --exclude=risc0-zkvm-methods --workspace | |
- run: sccache --show-stats | |
check-benchmarks: | |
if: needs.changes.outputs.check-benchmarks == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, macOS, cpu] | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: macOS-default | |
- run: cargo run --bin cargo-risczero --no-default-features -- risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- run: cargo check | |
working-directory: benchmarks | |
- run: sccache --show-stats | |
check-external: | |
if: needs.changes.outputs.check-external == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, macOS, cpu] | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: macOS-default | |
- run: cargo check | |
working-directory: external/substrate | |
- run: sccache --show-stats | |
check-semver: | |
if: needs.changes.outputs.check-semver == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, cpu, "${{ matrix.os }}"] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [Linux, macOS] | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: ${{ matrix.os }}-default | |
- name: Install cargo-semver-checks | |
uses: risc0/cargo-install@b9307573043522ab0d3e3be64a51763b765b52a4 | |
with: | |
crate: cargo-semver-checks | |
version: "0.29.1" | |
- name: run cargo semverchecks on ${{ github.event.pull_request.base.sha }} | |
# There seems to be a bug in cargo-semver-checks that can't locate the platform crate... | |
# All other excluded crates aren't published and therefore do not need this check | |
run: | | |
cargo semver-checks --default-features --baseline-rev ${{ github.event.pull_request.base.sha }} \ | |
--exclude risc0-zkvm-platform \ | |
--exclude doc-test --exclude fibonacci-methods --exclude risc0-zkvm-receipts --exclude risc0-zkvm-methods \ | |
--exclude bonsai-rest-api-mock | |
- run: sccache --show-stats | |
check-template: | |
if: needs.changes.outputs.check-template == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, cpu, "${{ matrix.os }}"] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [Linux, macOS] | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: ${{ matrix.os }}-default | |
- run: cargo install --force --path risc0/cargo-risczero | |
- run: cargo risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- run: | | |
cargo risczero new \ | |
--template templates/rust-starter \ | |
--templ-subdir="" \ | |
--path $(pwd) \ | |
--dest ${{ runner.temp }} \ | |
--guest-name test_method \ | |
template-test | |
shell: bash | |
- run: cargo run --release --manifest-path ${{ runner.temp }}/template-test/Cargo.toml | |
- run: ${{ runner.temp }}/template-test/target/release/host | |
- run: sccache --show-stats | |
crates-validator: | |
if: needs.changes.outputs.crates-validator == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, macOS, cpu] | |
env: | |
RISC0_BUILD_LOCKED: 1 | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: macOS-default | |
- run: cargo test | |
working-directory: tools/crates-validator | |
- run: sccache --show-stats | |
web: | |
if: needs.changes.outputs.web == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, Linux, cpu] | |
env: | |
RISC0_BUILD_LOCKED: 1 | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v4 | |
- uses: browser-actions/setup-firefox@v1 | |
- run: firefox --version | |
- uses: ./.github/actions/rustup | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- uses: ./.github/actions/sccache | |
with: | |
key: Linux-default | |
- run: cargo run --bin cargo-risczero --no-default-features -- risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- run: cargo xtask install | |
- run: cargo xtask gen-receipt | |
- run: | | |
npm install | |
npm test -- --firefox | |
working-directory: examples/browser-verify | |
- run: sccache --show-stats | |
reproducible-build: | |
if: needs.changes.outputs.test == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, Linux, cpu, docker] | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: Linux-default | |
- run: cargo run --bin cargo-risczero --no-default-features -- risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- run: cargo test -p risc0-build -F docker | |
- run: cargo test -p risc0-zkvm -F docker -F prove -- "docker::" | |
env: | |
RISC0_USE_DOCKER: "1" | |
- run: sccache --show-stats | |
stark2snark: | |
if: needs.changes.outputs.stark2snark == 'true' | |
needs: changes | |
runs-on: [self-hosted, prod, Linux, cpu, docker] | |
steps: | |
# This is a workaround from: https://github.com/actions/checkout/issues/590#issuecomment-970586842 | |
- run: "git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :" | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- run: git lfs pull | |
- uses: ./.github/actions/rustup | |
- uses: ./.github/actions/sccache | |
with: | |
key: Linux-default | |
- run: cargo run --bin cargo-risczero --no-default-features -- risczero install --version $RISC0_TOOLCHAIN_VERSION | |
- run: cargo test -p risc0-groth16 -F docker --release | |
- run: cargo test -p risc0-zkvm -F prove -F docker -- tests::stark2snark | |
- run: sccache --show-stats |