-
-
Notifications
You must be signed in to change notification settings - Fork 13
52 lines (40 loc) · 1.08 KB
/
lint.yml
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
name: Lint
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup component add clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref_name == 'main' }}
- name: Run cargo clippy with all features enabled
run: cargo clippy --all-targets --all-features -- -D warnings
rustfmt:
if: github.ref_name != 'main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup component add rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
dprint:
if: github.ref_name != 'main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lint Markdown and TOML
uses: dprint/check@v2.2