chore: add more unused precompile checks & new ci to avoid commited patches #311
Workflow file for this run
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: Rust Checks | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check-scripts: | |
name: Check bash scripts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download and Extract Fixtures | |
run: | | |
chmod +x ./scripts/download-and-extract-fixtures.sh | |
./scripts/download-and-extract-fixtures.sh v5.1.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
check-precompile-patches: | |
name: Check ${{ matrix.zkVM }} unused precompile patches | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- zkVM: reth-sp1-stateless-validator | |
xtask: sp1 | |
- zkVM: reth-risc0-stateless-validator | |
xtask: risc0 | |
- zkVM: reth-zisk-stateless-validator | |
xtask: zisk | |
- zkVM: reth-pico-stateless-validator | |
xtask: pico | |
# - zkVM: reth-openvm-stateless-validator # See #168 | |
# xtask: openvm | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: ere-guests | |
- name: Check for unused [patch] entries | |
shell: bash | |
run: | | |
set -euo pipefail | |
cargo ${{ matrix.xtask }} | |
cd ere-guests | |
if cargo tree -p ${{ matrix.zkVM }} 2>&1 | grep -F "was not used in the crate graph"; then | |
exit 1 | |
fi | |
check-non-ere-hosts: | |
name: Checks on non ere-hosts crates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy, rustfmt | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Check formatting | |
run: cargo fmt --check --all | |
- name: Check clippy | |
run: cargo clippy --bins --lib --examples --tests --benches --all-features -p witness-generator -p zkevm-metrics -p benchmark-runner | |
- name: Run tests | |
env: | |
RPC_URL: ${{ secrets.RPC_URL }} | |
RPC_HEADERS: ${{ secrets.RPC_HEADERS }} | |
run: cargo test -p zkevm-metrics -p witness-generator -- --no-capture | |
check-ere-host: | |
name: Checks crate ere-hosts | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy, rustfmt | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Cargo check | |
run: cargo check -p ere-hosts | |
- name: Check clippy | |
run: cargo clippy --bins --examples --tests --benches -p ere-hosts | |
check-empty-patch-crates-io: | |
name: Check [patch.crates-io] is empty | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Check patch.crates-io is empty in ere-guests/Cargo.toml | |
run: | | |
# Extract lines between [patch.crates-io] and the next section | |
# Fail if there are non-empty, non-comment lines | |
sed -n '/^\[patch\.crates-io\]/,/^\[/p' ere-guests/Cargo.toml | \ | |
sed '1d;$d' | \ | |
grep -v '^[[:space:]]*#' | \ | |
grep -v '^[[:space:]]*$' && \ | |
{ echo "ERROR: [patch.crates-io] section in ere-guests/Cargo.toml must be empty"; exit 1; } || \ | |
echo "✓ [patch.crates-io] section is empty" |