-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (46 loc) · 1.4 KB
/
lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Lint
on:
pull_request:
push:
branches:
- main
- releases/**
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lints:
name: Lints
runs-on: blacksmith-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Install Rust nightly toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.81.0
components: clippy
- name: Rust Cache
uses: useblacksmith/rust-cache@v3
with:
shared-key: "cache"
- name: Install cargo-sort
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-sort
- name: Run cargo sort
run: cargo-sort --workspace --check --check-format
- name: Run cargo clippy (no features)
run: cargo clippy --workspace --no-default-features --allow-dirty --fix -- -D warnings
- name: Run cargo clippy (all features)
run: cargo clippy --workspace --all-features --allow-dirty --fix -- -D warnings
- name: Run cargo doc
run: cargo doc --no-deps --workspace
- name: Check for uncommitted changes
run: git diff --exit-code