-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (83 loc) · 2.45 KB
/
lint.yml
File metadata and controls
98 lines (83 loc) · 2.45 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Lint
on:
pull_request:
merge_group:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
permissions: {}
jobs:
clippy:
name: Run clippy on crates
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@22a6a5b0f9f487c5f5587025ae9d4a1caf2a8a78 # clippy
- name: Rust cache
uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
with:
cache-on-failure: true
- name: Run clippy
run: cargo clippy --examples --tests --benches --all-features --all-targets --locked
env:
RUSTFLAGS: -D warnings
fmt:
name: Check code formatting
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
with:
components: rustfmt
- name: Check Rust formatting
run: cargo fmt --all --check
taplo:
name: Lint and check formatting of TOML files
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4
with:
persist-credentials: false
- name: Install latest taplo
run: |
curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-x86_64.gz \
| gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo
- name: Run taplo lint
run: |
taplo lint
- name: Run taplo format check
run: |
taplo fmt --check
lint-success:
name: Check that lints passed
runs-on: ubuntu-latest
if: always()
needs:
- clippy
- fmt
- taplo
timeout-minutes: 30
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
with:
jobs: ${{ toJSON(needs) }}