Skip to content

Clippy

Clippy #14

Workflow file for this run

# ----------------------------------------
# CI Workflow (Clippy)
# ----------------------------------------
# Runs on pull requests to main & develop.
# Checks:
# - clippy lints (fails on warnings)
# Uses caching to speed up Cargo builds.
# ----------------------------------------
name: Clippy
on:
# Manual trigger
workflow_dispatch:
# Run on PRs targeting main and develop
pull_request:
branches: [ main, develop ]
# Run on Pushes targeting main
push:
branches: [ main ]
# Weekly scheduled scan (Monday 03:00 UTC)
schedule:
- cron: '0 3 * * 1'
env:
CARGO_TERM_COLOR: always
jobs:
# -------------------------------------------------
# Linux Clippy (GNU + MUSL)
# -------------------------------------------------
clippy-linux:
name: Clippy (Linux GNU + MUSL)
runs-on: ubuntu-latest
steps:
# ----------------------------------------
# Checkout source code
# ----------------------------------------
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
# ----------------------------------------
# Install Rust (clippy)
# ----------------------------------------
- name: Install Rust (rust-toolchain.toml)
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
# ----------------------------------------
# Install MUSL tooling
# ----------------------------------------
- name: Install MUSL tooling
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
rustup target add x86_64-unknown-linux-musl
# ----------------------------------------
# Cache Cargo builds
# ----------------------------------------
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/rust-toolchain.toml', '**/rust-toolchain') }}
restore-keys: |
${{ runner.os }}-cargo-
# ----------------------------------------
# Run clippy (GNU)
# ----------------------------------------
- name: Clippy (GNU)
run: |
rustc -vV | sed -n 's/^host: //p'
cargo -vV
echo "Running clippy with explicit --target GNU"
cargo clippy --workspace --all-targets --all-features --target x86_64-unknown-linux-gnu
echo "Target dir check:"
ls -la target/x86_64-unknown-linux-gnu || true
# `--all-targets` lints tests, benches, and examples
# `--all-features` ensures feature-gated code is checked
# `--workspace` ensures all crates are checked
# ----------------------------------------
# Run clippy (MUSL)
# ----------------------------------------
- name: Clippy (MUSL)
run: |
rustc -vV | sed -n 's/^host: //p'
cargo -vV
echo "Running clippy with explicit --target MUSL"
cargo clippy --workspace --all-targets --all-features --target x86_64-unknown-linux-musl
echo "Target dir check:"
ls -la target/x86_64-unknown-linux-musl || true
# `--all-targets` lints tests, benches, and examples
# `--all-features` ensures feature-gated code is checked
# `--workspace` ensures all crates are checked
# -------------------------------------------------
# Windows Clippy (MSVC)
# -------------------------------------------------
clippy-windows:
name: Clippy (Windows MSVC)
runs-on: windows-latest
steps:
# ----------------------------------------
# Checkout source code
# ----------------------------------------
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
# ----------------------------------------
# Install Rust (clippy)
# ----------------------------------------
- name: Install Rust (rust-toolchain.toml)
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
# ----------------------------------------
# Cache Cargo builds
# ----------------------------------------
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
C:\Users\runneradmin\.cargo\registry
C:\Users\runneradmin\.cargo\git
target
key: windows-cargo-${{ hashFiles('**/Cargo.lock', '**/rust-toolchain.toml', '**/rust-toolchain') }}
# ----------------------------------------
# Run clippy (Windows)
# ----------------------------------------
- name: Clippy (Windows)
run: cargo clippy --workspace --all-targets --all-features