Skip to content

forkchoice grafana visualization #1642

forkchoice grafana visualization

forkchoice grafana visualization #1642

Workflow file for this run

on:
push:
# We intentionally don't run push on feature branches
branches: [main]
pull_request:
workflow_dispatch:
# only one can run at a time in PRs
concurrency:
# If PR, cancel prev commits. head_ref = source branch name on pull_request, null if push
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: CI
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Zig
uses: mlugg/[email protected]
with:
version: 0.14.1
- name: Cache Zig packages
uses: actions/cache@v3
with:
path: ~/.cache/zig
key: ${{ runner.os }}-zig-packages-${{ hashFiles('build.zig.zon') }}
restore-keys: |
${{ runner.os }}-zig-packages-
- name: Fetch Zig dependencies with retry
run: |
max_attempts=5
attempt=1
while [ $attempt -le $max_attempts ]; do
if zig build --fetch; then
echo "Successfully fetched dependencies on attempt $attempt"
exit 0
fi
echo "Attempt $attempt/$max_attempts failed, retrying in 5 seconds..."
sleep 5
attempt=$((attempt + 1))
done
echo "Failed to fetch dependencies after $max_attempts attempts"
exit 1
- name: Set up Rust/Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy, rustfmt
- name: Verify installation
run: |
rustc --version
cargo --version
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check Rust formatting
run: |
cargo fmt --manifest-path rust/Cargo.toml --all -- --check
- name: Run clippy on hosts
run: |
cargo clippy --manifest-path rust/Cargo.toml --workspace -- -D warnings
- name: Lint
run: zig fmt --check .
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Zig
uses: mlugg/[email protected]
with:
version: 0.14.1
- name: Set up Rust/Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Cache Zig packages
uses: actions/cache@v3
with:
path: ~/.cache/zig
key: ${{ runner.os }}-zig-packages-${{ hashFiles('build.zig.zon') }}
restore-keys: |
${{ runner.os }}-zig-packages-
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "rust -> target"
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Fetch Zig dependencies with retry
run: |
max_attempts=5
attempt=1
while [ $attempt -le $max_attempts ]; do
if zig build --fetch; then
echo "Successfully fetched dependencies on attempt $attempt"
exit 0
fi
echo "Attempt $attempt/$max_attempts failed, retrying in 5 seconds..."
sleep 5
attempt=$((attempt + 1))
done
echo "Failed to fetch dependencies after $max_attempts attempts"
exit 1
- name: build
run: zig build all
build-all-provers:
name: build-all-provers
runs-on: ubuntu-latest
needs: build # Only run if the build job succeeds
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Zig
uses: mlugg/[email protected]
with:
version: 0.14.1
- name: Set up Rust/Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: clippy, rustfmt
- name: Cache Zig packages
uses: actions/cache@v3
with:
path: ~/.cache/zig
key: ${{ runner.os }}-zig-packages-${{ hashFiles('build.zig.zon') }}
restore-keys: |
${{ runner.os }}-zig-packages-
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "rust -> target"
key: ${{ runner.os }}-cargo-all-provers-${{ hashFiles('**/Cargo.lock') }}
- name: Fetch Zig dependencies with retry
run: |
max_attempts=5
attempt=1
while [ $attempt -le $max_attempts ]; do
if zig build --fetch; then
echo "Successfully fetched dependencies on attempt $attempt"
exit 0
fi
echo "Attempt $attempt/$max_attempts failed, retrying in 5 seconds..."
sleep 5
attempt=$((attempt + 1))
done
echo "Failed to fetch dependencies after $max_attempts attempts"
exit 1
- name: Build with all provers
run: zig build -Dprover=all
test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Zig
uses: mlugg/[email protected]
with:
version: 0.14.1
- name: Set up Rust/Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Cache Zig packages
uses: actions/cache@v3
with:
path: ~/.cache/zig
key: ${{ runner.os }}-zig-packages-${{ hashFiles('build.zig.zon') }}
restore-keys: |
${{ runner.os }}-zig-packages-
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "rust -> target"
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
- name: Fetch Zig dependencies with retry
run: |
max_attempts=5
attempt=1
while [ $attempt -le $max_attempts ]; do
if zig build --fetch; then
echo "Successfully fetched dependencies on attempt $attempt"
exit 0
fi
echo "Attempt $attempt/$max_attempts failed, retrying in 5 seconds..."
sleep 5
attempt=$((attempt + 1))
done
echo "Failed to fetch dependencies after $max_attempts attempts"
exit 1
- name: Run all unit tests
run: zig build test --summary all
- name: Run all sim tests
run: zig build simtest --summary all
- name: Install uv
shell: bash
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Generate LeanSpec fixtures
working-directory: leanSpec
run: uv run fill --clean --fork=devnet
- name: Generate spec fixtures
run: zig build spectest:generate --summary all
- name: Run all spec tests
run: zig build spectest:run --summary all
dummy-prove:
name: Dummy prove
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Zig
uses: mlugg/[email protected]
with:
version: 0.14.1
- name: Set up Rust/Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Cache Zig packages
uses: actions/cache@v3
with:
path: ~/.cache/zig
key: ${{ runner.os }}-zig-packages-${{ hashFiles('build.zig.zon') }}
restore-keys: |
${{ runner.os }}-zig-packages-
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "rust -> target"
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}
- name: Run the dummy prover
run: zig build run -Dprover=dummy -- prove --zkvm dummy
docker-build:
name: docker-build
needs: [lint, build, test, build-all-provers]
strategy:
matrix:
builder: [ubuntu-latest, ubuntu-22.04-arm]
runs-on: ${{ matrix.builder }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history to get git commit info
- name: Set up Zig
uses: mlugg/[email protected]
with:
version: 0.14.1
- name: Set up Rust/Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Cache Zig packages
uses: actions/cache@v3
with:
path: ~/.cache/zig
key: ${{ runner.os }}-zig-packages-${{ hashFiles('build.zig.zon') }}
restore-keys: |
${{ runner.os }}-zig-packages-
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "rust -> target"
key: ${{ runner.os }}-cargo-docker-${{ hashFiles('**/Cargo.lock') }}
- name: Build zeam natively
run: zig build -Doptimize=ReleaseFast -Dgit_version="$(git rev-parse --short HEAD)"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image with pre-built binary
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.prebuilt
push: false # Don't push, just build to verify
tags: zeam:ci-${{ github.run_number }}
cache-from: type=gha
cache-to: type=gha,mode=max