-
-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (63 loc) · 1.8 KB
/
lints.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
"on":
push:
branches: [main, staging, trying]
pull_request:
branches: [main]
name: Lints
jobs:
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Get current MSRV from crates/plex-api/Cargo.toml
id: current_msrv
run: |
msrv=$(cat crates/plex-api/Cargo.toml | grep rust-version | sed 's/.* = "//; s/"//')
echo "msrv=$msrv" >> $GITHUB_OUTPUT
- name: Install the toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{steps.current_msrv.outputs.msrv}}
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: cache
- name: Check
run: cargo check --workspace --all-targets
- name: Check the new MSRV
if: ${{ failure() }}
run: |
cargo install cargo-msrv
cargo msrv --bisect --min ${{steps.current_msrv.outputs.msrv}}
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: cache
- name: Run cargo check
run: cargo check
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: "rustfmt,clippy"
- uses: Swatinem/rust-cache@v2.7.3
with:
shared-key: cache
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Clippy with warnings
run: cargo clippy --all-targets --all-features -- -D warnings