ci: Run clippy check

This commit is contained in:
Jade Ellis 2025-05-11 19:43:56 +01:00
parent c5db43ba9a
commit e31d261e66
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2

View file

@ -1,29 +1,43 @@
name: Rust Formatting name: Rust Formatting
on: on:
push: push:
pull_request: pull_request:
jobs: jobs:
format: format:
name: Format name: Format
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
persist-credentials: false persist-credentials: false
- name: Install rust - name: Install rust
uses: ./.forgejo/actions/rust-toolchain uses: ./.forgejo/actions/rust-toolchain
with: with:
toolchain: "nightly" toolchain: "nightly"
components: "rustfmt" components: "rustfmt"
- name: Check formatting
run: |
cargo +nightly fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install rust
uses: ./.forgejo/actions/rust-toolchain
- uses: https://github.com/actions/create-github-app-token@v2 - uses: https://github.com/actions/create-github-app-token@v2
id: app-token id: app-token
with: with:
@ -36,9 +50,20 @@ jobs:
uses: ./.forgejo/actions/sccache uses: ./.forgejo/actions/sccache
with: with:
token: ${{ steps.app-token.outputs.token }} token: ${{ steps.app-token.outputs.token }}
- run: sudo apt-get update
- name: Install system dependencies
uses: https://github.com/awalsh128/cache-apt-pkgs-action@v1
with:
packages: clang liburing-dev
version: 1
- name: Check formatting - name: Check formatting
run: | run: |
cargo +nightly fmt --all -- --check cargo clippy \
--workspace \
--locked \
--profile test \
-- \
-D warnings
- name: Show sccache stats - name: Show sccache stats
run: sccache --show-stats run: sccache --show-stats