-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9fca66
commit 11dbdbe
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
name: Clippy check | ||
|
||
# Make sure CI fails on all warnings, including Clippy lints | ||
env: | ||
RUSTFLAGS: "-Dwarnings" | ||
|
||
jobs: | ||
fmt_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check if code is formatted properly | ||
run: cargo fmt --check --all | ||
|
||
clippy_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Cache Cargo Registry | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | ||
- name: Run Clippy | ||
run: cargo clippy --all-targets --all-features | ||
|
||
udeps: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cache Cargo Binaries | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cargo/bin | ||
key: ${{ runner.os }}-cargo-bin | ||
restore-keys: | | ||
${{ runner.os }}-cargo-bin | ||
- name: Cache Rust Toolchain | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.rustup/toolchains | ||
~/.rustup/update-hashes | ||
key: ${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain') }} | ||
restore-keys: | | ||
${{ runner.os }}-rust-toolchain-${{ hashFiles('rust-toolchain') }} | ||
- name: Cache Cargo Registry | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} | ||
- uses: actions/checkout@v4 | ||
- name: Install nightly | ||
run: rustup toolchain install nightly | ||
- name: Install udeps | ||
run: cargo install cargo-udeps --locked | ||
- name: Run udeps | ||
run: cargo +nightly udeps |