Update finalized ceremony docs #1116
Workflow file for this run
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: risc0-ethereum CI | |
on: | |
merge_group: | |
pull_request: | |
branches: [main, "release-*"] | |
workflow_dispatch: | |
inputs: | |
risc0-ethereum-branch: | |
description: "risc0-ethereum branch to checkout" | |
required: false | |
default: 'main' | |
bonsai-foundry-template-branch: | |
description: "bonsai-foundry-template branch to checkout" | |
required: false | |
default: 'main' | |
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-04-22.0 | |
RISC0_PATH: ${{ github.workspace }}/risc0 | |
RISC0_ETHEREUM_PATH: ${{ github.workspace }}/risc0-ethereum | |
BONSAI_FOUNDRY_TEMPLATE_PATH: ${{ github.workspace }}/bonsai-foundry-template | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
test: ${{ steps.filter.outputs.test }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: risc0/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 | |
id: filter | |
with: | |
filters: | | |
base: &base | |
- .github/actions/** | |
- .github/workflows/risc0-ethereum.yml | |
- Cargo.toml | |
- rust-toolchain.toml | |
- Cargo.lock | |
test: | |
- *base | |
- bonsai/** | |
- risc0/** | |
# see: https://github.com/orgs/community/discussions/26822 | |
risc0-ethereum-status-check: | |
if: always() | |
needs: | |
- test | |
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 | |
test: | |
if: ${{ needs.changes.outputs.test == 'true' || github.event_name == 'workflow_dispatch'}} | |
needs: changes | |
runs-on: [self-hosted, prod, Linux, cpu, docker] | |
env: | |
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) || :" | |
# Checkout risc0 | |
- uses: actions/checkout@v4 | |
with: | |
path: 'risc0' | |
# Checkout risc0-ethereum | |
- name: Checkout risc0-ethereum | |
uses: actions/checkout@v4 | |
with: | |
repository: 'risc0/risc0-ethereum' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
submodules: recursive | |
path: 'risc0-ethereum' | |
ref: ${{ github.event.inputs.risc0-ethereum-branch || 'main' }} | |
# Checkout bonsai-foundry-template | |
- name: Checkout foundry-template | |
uses: actions/checkout@v4 | |
with: | |
repository: 'risc0/bonsai-foundry-template' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
submodules: recursive | |
path: 'bonsai-foundry-template' | |
ref: ${{ github.event.inputs.bonsai-foundry-template-branch || 'main' }} | |
- uses: ./risc0/.github/actions/rustup | |
- uses: ./risc0/.github/actions/sccache | |
with: | |
key: Linux-default | |
# Installing dev tooling | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install python dependencies | |
run: python -m pip install --upgrade toml | |
- name: Install risczero toolchain | |
run: | | |
cargo install --force --path risc0/cargo-risczero | |
cargo risczero install --version $RISC0_TOOLCHAIN_VERSION | |
working-directory: risc0 | |
- uses: risc0/foundry-toolchain@2fe7e70b520f62368a0e3c464f997df07ede420f | |
with: | |
version: nightly-09fe3e041369a816365a020f715ad6f94dbce9f2 | |
# Apply local patch | |
- name: Local patch on risc0-ethereum | |
run: python ${{ env.RISC0_PATH }}/.github/cargo_local_patch.py . | |
working-directory: ${{ env.RISC0_ETHEREUM_PATH }} | |
- name: Local patch on bonsai-foundry-template | |
run: python ${{ env.RISC0_PATH }}/.github/cargo_local_patch.py . | |
working-directory: ${{ env.BONSAI_FOUNDRY_TEMPLATE_PATH }} | |
# Run Bootstrap-groth16 to update test receipt for checking | |
# the latest groth16 prover against the solidity verifier on risc0-ethereum | |
- name: Bootstrap-groth16 test receipt | |
run: cargo xtask bootstrap-groth16 --test-receipt-only | |
env: | |
RISC0_ETHEREUM_PATH: ${{ env.RISC0_ETHEREUM_PATH }} | |
working-directory: ${{ env.RISC0_PATH }} | |
# Build and test risc0-ethereum | |
- name: build risc0-ethereum | |
run: cargo test --workspace --no-run | |
working-directory: ${{ env.RISC0_ETHEREUM_PATH }} | |
- name: test risc0-ethereum | |
run: cargo test --workspace | |
working-directory: ${{ env.RISC0_ETHEREUM_PATH }} | |
- name: forge test on risc0-ethereum | |
run: forge test -vvv | |
working-directory: ${{ env.RISC0_ETHEREUM_PATH }}/contracts | |
# Build and test bonsai-foundry-template | |
- name: build bonsai-foundry-template | |
run: cargo build | |
working-directory: ${{ env.BONSAI_FOUNDRY_TEMPLATE_PATH }} | |
- name: build bonsai-foundry-template contracts | |
run: forge build | |
working-directory: ${{ env.BONSAI_FOUNDRY_TEMPLATE_PATH }} | |
- name: run foundry tests in dev mode | |
env: | |
RISC0_DEV_MODE: true | |
run: forge test -vvv | |
working-directory: ${{ env.BONSAI_FOUNDRY_TEMPLATE_PATH }} | |
- run: sccache --show-stats |