Skip to content

Clippy issues resolved #20

Clippy issues resolved

Clippy issues resolved #20

Workflow file for this run

# .github/workflows/ci.yml
#
# Continuous Integration — runs on every push and pull request to main/master.
#
# Jobs:
# test — cargo test (all unit + integration tests)
# clippy — cargo clippy (deny warnings)
# fmt — cargo fmt --check (enforce consistent formatting)
# audit — cargo audit (known CVEs in dependencies) [#16]
#
# cargo-audit is installed from crates.io on each run.
# Cache the registry + build artifacts to keep runs fast.
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry & build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Run tests
run: cargo test --all-features
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable + clippy
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.lock') }}
- name: Run Clippy (deny warnings)
run: cargo clippy --all-targets --all-features -- -D warnings
fmt:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable + rustfmt
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all --check
audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-audit-${{ hashFiles('**/Cargo.lock') }}
- name: Install cargo-audit
run: cargo install cargo-audit --locked
- name: Run cargo audit
# --deny unsound: also fail on soundness issues, not only CVEs
run: cargo audit --deny unsound