Skip to content

Initial commit

Initial commit #9

name: Lint
on:
workflow_dispatch: {}
push:
branches:
- "main"
paths:
- '**/*.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/*.yml'
- '.github/actions/**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**/*.rs'
- '**/Cargo.toml'
- '**/Cargo.lock'
- '.github/workflows/*.yml'
- '.github/actions/**'
concurrency:
group: lint-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RISC0_SKIP_BUILD: 1
CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu
jobs:
format:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.ref }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Check for formatting differences
run: cargo fmt --all -- --check
clippy:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-24.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up CI environment
uses: ./.github/actions/setup-rust-ci
with:
ssh-private-key: ${{ secrets.MERK_NOMIC_SSH_KEY }}
- name: Clippy (full workspace, all targets)
run: cargo clippy --workspace --all-targets --locked -- -D warnings
spell-check:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
with:
files: ./**/*.rs