Fix jalr circuit (#284) #1006
This file contains hidden or 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: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
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 }} | |
AUDITHUB_BASE_URL: ${{ secrets.AUDITHUB_BASE_URL }} | |
AUDITHUB_OIDC_CONFIGURATION_URL: ${{ secrets.AUDITHUB_OIDC_CONFIGURATION_URL }} | |
AUDITHUB_OIDC_CLIENT_ID: ${{ secrets.AUDITHUB_OIDC_CLIENT_ID }} | |
AUDITHUB_OIDC_CLIENT_SECRET: ${{ secrets.AUDITHUB_OIDC_CLIENT_SECRET }} | |
AUDITHUB_ORGANIZATION_ID: ${{ secrets.AUDITHUB_ORGANIZATION_ID }} | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Full history is required by license-check.py | |
fetch-depth: 0 | |
- uses: risc0/risc0/.github/actions/rustup@a9d723e29a44563497220a998b5de4e03d9da049 | |
- name: Install cargo-sort | |
uses: risc0/cargo-install@9f6037ed331dcf7da101461a20656273fa72abf0 | |
with: | |
crate: cargo-sort | |
version: "1.0" | |
- run: cargo fmt --all -- --check | |
- run: cargo fmt --manifest-path zirgen/bootstrap/Cargo.toml -- --check | |
- run: cargo sort --workspace --check | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- run: python license-check.py | |
check-generated-zirgen: | |
runs-on: [self-hosted, prod, Linux, cpu] | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [Linux] | |
env: | |
RUST_BACKTRACE: full | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/bazelisk | |
with: | |
cache-key: bootstrap | |
- uses: risc0/risc0/.github/actions/rustup@a9d723e29a44563497220a998b5de4e03d9da049 | |
- uses: risc0/risc0/.github/actions/sccache@1a373c71585766e4f6985b96c48389daaf69d528 | |
with: | |
key: ${{ matrix.os }}-bootstrap | |
# TODO: check generated fib files once they generate properly | |
# - name: fib generated files up to date | |
# run: cargo bootstrap -- --check fib | |
- name: calculator generated files up to date | |
run: cargo bootstrap -- --check calculator | |
bazel: | |
runs-on: [self-hosted, prod, cpu, "${{ matrix.os }}"] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [Linux, macOS] | |
include: | |
- os: Linux | |
config: --config=ci | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/bazelisk | |
with: | |
cache-key: build | |
- name: Build & test | |
env: | |
CONFIG: ${{ matrix.config }} | |
run: bazelisk test //... $CONFIG | |
test: | |
runs-on: [self-hosted, prod, "${{ matrix.os }}", "${{ matrix.arch }}", "${{ matrix.device }}"] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: Linux | |
arch: X64 | |
feature: default | |
device: cpu | |
- os: Linux | |
arch: X64 | |
feature: cuda | |
device: nvidia_rtx_a5000 | |
- os: macOS | |
arch: ARM64 | |
feature: default | |
device: apple_m2_pro | |
env: | |
FEATURE: ${{ matrix.feature }} | |
RISC0_BUILD_LOCKED: 1 | |
RUST_BACKTRACE: full | |
steps: | |
- uses: actions/checkout@v4 | |
- if: matrix.feature == 'cuda' | |
uses: ./.github/actions/cuda | |
- uses: risc0/risc0/.github/actions/rustup@a9d723e29a44563497220a998b5de4e03d9da049 | |
- uses: risc0/risc0/.github/actions/sccache@1a373c71585766e4f6985b96c48389daaf69d528 | |
with: | |
key: ${{ matrix.os }}-${{ matrix.feature }} | |
- run: | | |
curl -L https://risczero.com/install | bash | |
echo "$HOME/.risc0/bin" >> $GITHUB_PATH | |
shell: bash | |
- run: rzup install rust | |
- run: cargo test --locked -F $FEATURE | |
- run: cargo check --benches | |
- run: cargo check --manifest-path zirgen/bootstrap/Cargo.toml | |
- run: sccache --show-stats | |
doc: | |
runs-on: [self-hosted, prod, Linux, cpu] | |
env: | |
RUST_BACKTRACE: full | |
RISC0_BUILD_LOCKED: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: risc0/risc0/.github/actions/rustup@a9d723e29a44563497220a998b5de4e03d9da049 | |
- uses: risc0/risc0/.github/actions/sccache@1a373c71585766e4f6985b96c48389daaf69d528 | |
- run: | | |
curl -L https://risczero.com/install | bash | |
echo "$HOME/.risc0/bin" >> $GITHUB_PATH | |
shell: bash | |
- run: rzup install rust | |
- run: cargo doc --no-deps --workspace | |
- run: sccache --show-stats | |
keccak-determinism: | |
runs-on: [self-hosted, prod, cpu, Linux] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/bazelisk | |
with: | |
cache-key: picus | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Verify Keccak circuit is deterministic | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
git clone https://github.com/Veridise/AuditHub-Client.git | |
cd AuditHub-Client | |
pip3 install poetry | |
poetry install | |
cd .. | |
bazelisk build //zirgen/circuit/keccak:picus_archive --config=ci | |
./bazel/rules/zirgen/picus_verify.sh $(bazelisk cquery //zirgen/circuit/keccak:picus_archive --output=files) keccak.picus | |
shell: bash | |
# see: https://github.com/orgs/community/discussions/26822 | |
main-status-check: | |
if: always() | |
needs: | |
- check | |
- bazel | |
- test | |
- doc | |
- check-generated-zirgen | |
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 |