Skip to content

ci(l1): build the reorg-test ethrex binary with release-fast #23260

ci(l1): build the reorg-test ethrex binary with release-fast

ci(l1): build the reorg-test ethrex binary with release-fast #23260

name: L2 Prover
on:
push:
branches: ["main"]
pull_request:
branches: ["**"]
workflow_dispatch:
permissions:
contents: read
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# Work around frequent libgit2/submodule fetch flakiness in CI.
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
CARGO_NET_RETRY: "10"
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.finish.outputs.run_tests }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
run_tests:
- '!docs/**'
- name: finish
id: finish
run: echo "run_tests=${{ steps.filter.outputs.run_tests }}" >> "$GITHUB_OUTPUT"
- name: Print result
run: echo "run_tests=${{ steps.finish.outputs.run_tests }}"
lint_zk:
name: Lint ${{ matrix.backend }} backend
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
# Note: openvm backend linting is disabled due to a problem in the installation https://github.com/lambdaclass/ethrex/issues/5509
# Note: risc0 backend linting is temporarily disabled: the c-kzg 2.1.8 floor exceeds the
# highest risc0 c-kzg fork tag (v2.1.7-risczero.0), so the guest workspace can't resolve.
# Re-add "risc0" once risc0/c-kzg-4844 publishes a >=2.1.8 tag.
backend: ["sp1", "zisk"]
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Free Disk Space
uses: ./.github/actions/free-disk
- name: Add Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install RISC0
if: matrix.backend == 'risc0'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/actions/install-risc0
- name: Install SP1
if: matrix.backend == 'sp1'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/actions/install-sp1
- name: Install ZisK
if: matrix.backend == 'zisk'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SETUP_KEY: none
uses: ./.github/actions/install-zisk
- name: RISC-V OpenVM toolchain install
if: matrix.backend == 'openvm'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
rustup install nightly-2025-02-14
rustup component add rust-src --toolchain nightly-2025-02-14
cargo +1.86 install --locked --git https://github.com/openvm-org/openvm.git --tag v1.4.1 cargo-openvm
- name: Check ${{ matrix.backend }} backend
run: |
cargo check -r -p ethrex-prover -F "${{ matrix.backend }},ci"
- name: Clippy ${{ matrix.backend }} backend
run: |
cargo clippy -r -p ethrex-prover --all-targets -F "${{ matrix.backend }},ci"
- name: Check ${{ matrix.backend }} Cargo.lock modified but not committed
run: |
git diff --exit-code -- crates/guest-program/bin/${{ matrix.backend }}/Cargo.lock
lint_exec:
name: Lint exec backend
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Add Rust Cache
uses: Swatinem/rust-cache@v2
- name: Check exec
run: |
cargo check -p ethrex-prover
- name: Clippy exec
run: |
cargo clippy -p ethrex-prover --all-targets
lint_tdx:
name: Lint tdx backend
needs: detect-changes
if: ${{ needs.detect-changes.outputs.run_tests == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6
- name: Add Rust Cache
uses: Swatinem/rust-cache@v2
- name: Check tdx
run: |
cd crates/l2/tee/quote-gen
cargo check
- name: Clippy tdx
run: |
cd crates/l2/tee/quote-gen
cargo clippy --all-targets
# The purpose of this job is to add it as a required check in GitHub so that we don't have to add every individual job as a required check
all-tests:
# "Lint" is a required check, don't change the name
name: Lint
runs-on: ubuntu-latest
needs: [detect-changes, lint_exec, lint_tdx, lint_zk]
# Make sure this job runs even if the previous jobs failed or were skipped
if: ${{ needs.detect-changes.outputs.run_tests == 'true' && always() && needs.lint_exec.result != 'skipped' && needs.lint_tdx.result != 'skipped' && needs.lint_zk.result != 'skipped' }}
steps:
- name: Check if any job failed
run: |
if [ "${{ needs.lint_exec.result }}" != "success" ]; then
echo "Job Lint exec Check failed"
exit 1
fi
if [ "${{ needs.lint_tdx.result }}" != "success" ]; then
echo "Job Lint TDX failed"
exit 1
fi
if [ "${{ needs.lint_zk.result }}" != "success" ]; then
echo "Job Lint ZK failed"
exit 1
fi