Skip to content

Merge upstream v4.2.0 (Hypercube update) #109

Merge upstream v4.2.0 (Hypercube update)

Merge upstream v4.2.0 (Hypercube update) #109

Workflow file for this run

name: Lint
on:
push:
tags:
- celo/v[0-9]*
branches:
- main
pull_request:
paths:
- ".github/workflows/lint.yml"
- "Cargo.toml"
- "Cargo.lock"
- "justfile"
- "crates/**"
- "programs/**"
- "scripts/**"
- "utils/**"
- "fault-proof/**"
- "validity/**"
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main' }}
jobs:
lint:
name: Formatting & Clippy
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: recursive
- name: Check SP1 version consistency
run: |
SP1_VERSION=$(grep 'sp1-sdk' Cargo.toml | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
echo "Expected SP1 version from Cargo.toml: $SP1_VERSION"
MISMATCHES=$(grep -rn 'sp1up -v' --include='Dockerfile*' | grep -v "$SP1_VERSION" || true)
MISMATCHES+=$(grep -rn 'sp1up -v' .github/workflows/ --exclude='lint.yml' | grep -v "$SP1_VERSION" || true)
MISMATCHES+=$(grep -n -- '--tag v' justfile | grep -v "$SP1_VERSION" || true)
if [ -n "$MISMATCHES" ]; then
echo "::error::SP1 version mismatch found. Expected $SP1_VERSION (from Cargo.toml):"
echo "$MISMATCHES"
exit 1
fi
echo "SP1 version consistency check passed"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy
- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install Go
run: |
GO_ARCH=$(dpkg --print-architecture)
curl -LO https://go.dev/dl/go1.24.0.linux-${GO_ARCH}.tar.gz
sudo tar -C /usr/local -xzf go1.24.0.linux-${GO_ARCH}.tar.gz
echo "/usr/local/go/bin" >> $GITHUB_PATH
- name: Install SP1 toolchain
run: |
curl -L https://sp1.succinct.xyz | bash
~/.sp1/bin/sp1up -v 6.0.2
~/.sp1/bin/cargo-prove prove --version
source ~/.bashrc
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: lint
cache-on-failure: true
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-targets --all-features --tests
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features --all-targets -- -D warnings -A incomplete-features