-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (54 loc) · 1.51 KB
/
linter.yml
File metadata and controls
65 lines (54 loc) · 1.51 KB
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
60
61
62
63
64
65
name: Linter check
on:
push:
branches: ["main"] # Runs on pushes to main branch
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- "flake.nix"
- "rustfmt.toml"
- "clippy.toml"
- ".github/workflows/linter.yml"
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
paths:
- "**/*.rs"
- "**/Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- "flake.nix"
- "rustfmt.toml"
- "clippy.toml"
- ".github/workflows/linter.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Dwarnings -C debuginfo=0"
jobs:
linter_check:
timeout-minutes: 20
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry and target
uses: Swatinem/rust-cache@v2
- name: Update apt package list
run: sudo apt-get update
- name: Install `protobuf`
uses: awalsh128/cache-apt-pkgs-action@v1.6.0
with:
packages: protobuf-compiler=3.21.12*
version: 3.21.12
- name: Install `oas3-gen`
run: cargo install oas3-gen@0.24.0
- name: Install `rustfmt`
run: rustup +nightly component add rustfmt
- name: Check formatting
run: cargo +nightly fmt --all -- --check
- name: Run Clippy
run: cargo clippy --locked --all-targets --all-features