-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (68 loc) · 2.16 KB
/
lint.yaml
File metadata and controls
80 lines (68 loc) · 2.16 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
---
name: Lint
on: # yamllint disable-line rule:truthy
- push
jobs:
manifests:
name: Manifests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pip install yamllint
- run: yamllint -s -f github .
formatting:
name: Formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo fmt --all --check
check:
name: Check
runs-on: ubuntu-20.04
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_VERSION: v0.3.3
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: /home/runner/.cache/sccache
# SCCACHE_RECACHE: 1 # Uncomment this to clear cache, then comment it back out
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install sccache
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
curl -L "$BASE_URL/$SCCACHE_VERSION/$FILE.tar.gz" | tar xz
mv -f $FILE/sccache $HOME/.local/bin/sccache
env:
BASE_URL: https://github.com/mozilla/sccache/releases/download
FILE: sccache-${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl
- name: Cache Cargo Registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: check-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
check-${{ runner.os }}-cargo-
${{ runner.os }}-cargo-
- name: Cache sccache
uses: actions/cache@v3
with:
path: ${{ env.SCCACHE_DIR }}
key: check-${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
check-${{ runner.os }}-sccache-
${{ runner.os }}-sccache-
- name: Start sccache
run: sccache --start-server
- run: cargo check
- run: cargo clippy -- -D warnings
- name: Show sccache stats
run: sccache --show-stats
- name: Stop sccache
run: sccache --stop-server || true