Skip to content

Hint IO in the SDK #3017

Hint IO in the SDK

Hint IO in the SDK #3017

Workflow file for this run

name: Lints
on:
merge_group:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
lints:
name: Various lints
timeout-minutes: 30
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt, clippy
targets: riscv32im-unknown-none-elf
# TODO(Matthias): see whether we can keep this in sync with rust-toolchain.toml automatically?
toolchain: nightly-2024-12-06
- name: Cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
guest/target/
key: lint-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: lint-${{ runner.os }}-cargo-
- name: Install cargo make
run: |
cargo make --version || cargo install cargo-make
- name: Check code format
run: cargo fmt --all --check
- name: Run clippy
env:
RUSTFLAGS: "-Dwarnings"
run: |
cargo check --workspace --all-targets
# We have a lot of code under #[cfg(not(debug_assertions))] and similar,
# so we need to run cargo check in release mode, too:
cargo check --workspace --all-targets --release
cargo make clippy
# Same for clippy:
cargo clippy --workspace --all-targets --release
- name: Install taplo
run: taplo --version || cargo install taplo-cli
- name: Run taplo
run: taplo fmt --check --diff