chore: add lint

This commit is contained in:
lencx
2023-01-22 14:46:04 +08:00
parent b875727753
commit 1d7bb3e051
7 changed files with 63 additions and 12 deletions

14
.github/workflows/clippy.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
on: push
name: Clippy check
# Make sure CI fails on all warnings, including Clippy lints
env:
RUSTFLAGS: "-Dwarnings"
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Clippy
run: cargo clippy --all-targets --all-features

31
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: Lint CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | Ubuntu dependencies
run: sudo apt install libasound2-dev libudev-dev pkg-config
- name: Setup | Toolchain (clippy, rustfmt)
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Lint | Clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings
- name: Lint | Rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check