From 234f77536c0618e4095f74d2b6f7cf95db724b3b Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:28:09 -0500 Subject: [PATCH] feat(ci): add clippy, fmt, udeps workflows --- .github/workflows/lint.yml | 52 ++++++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..406dba4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,52 @@ +name: Lint + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + clippy: + name: clippy + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: clippy + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - run: cargo clippy --workspace --lib --examples --tests --benches --all-features --locked + env: + RUSTFLAGS: -D warnings + + fmt: + name: fmt + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + - name: Run fmt + run: cargo fmt --all --check + + udeps: + name: udeps + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + - uses: taiki-e/install-action@cargo-udeps + - run: cargo udeps --workspace --lib --examples --tests --benches --all-features --locked diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 773abbc..adccf7d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -25,7 +25,7 @@ jobs: test: runs-on: ubuntu-latest - + steps: - uses: actions/checkout@v4 with: