-
Notifications
You must be signed in to change notification settings - Fork 15
51 lines (41 loc) · 1.16 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
name: Lint
on:
push:
pull_request:
workflow_dispatch:
jobs:
lint:
name: Lint SourceCode
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: default
override: true
components: rustfmt, clippy
# Should use comitted lockfile
# - name: Generate Cargo.lock
# uses: actions-rs/cargo@v1
# with:
# command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: lint-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: lint-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cargo fmt
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --all-features
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache