1
- name : Rust
2
-
3
- on :
4
- pull_request :
5
- branches : [ "master", "rewrite/v3" ]
6
- push :
7
- branches : [ "master", "rewrite/v3" ]
8
- workflow_dispatch :
9
-
10
- env :
11
- CARGO_TERM_COLOR : always
12
-
13
1
jobs :
14
2
format :
15
3
name : Check code formatting
18
6
- name : Checkout repository
19
7
uses : actions/checkout@v4
20
8
9
+ - name : Restore cargo cache
10
+ uses : actions/cache@v3
11
+ with :
12
+ path : |
13
+ ~/.cargo/registry
14
+ ~/.cargo/git
15
+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
16
+ restore-keys : |
17
+ ${{ runner.os }}-cargo-
18
+
21
19
- name : Install Rust nightly
22
20
uses : dtolnay/rust-toolchain@nightly
23
21
@@ -34,14 +32,21 @@ jobs:
34
32
- name : Checkout repository
35
33
uses : actions/checkout@v4
36
34
35
+ - name : Restore cargo cache
36
+ uses : actions/cache@v3
37
+ with :
38
+ path : |
39
+ ~/.cargo/registry
40
+ ~/.cargo/git
41
+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
42
+ restore-keys : |
43
+ ${{ runner.os }}-cargo-
44
+
37
45
- name : Install Rust nightly
38
46
uses : dtolnay/rust-toolchain@nightly
39
47
40
- - name : Install clippy
41
- run : rustup component add clippy
42
-
43
48
- name : Run Clippy
44
- run : cargo clippy --all-targets -- -Dwarnings
49
+ run : cargo clippy -- -Dwarnings -Dclippy::all
45
50
46
51
security :
47
52
name : Check for security vulnerabilities
@@ -50,14 +55,24 @@ jobs:
50
55
- name : Checkout repository
51
56
uses : actions/checkout@v4
52
57
58
+ - name : Restore cargo cache
59
+ uses : actions/cache@v3
60
+ with :
61
+ path : |
62
+ ~/.cargo/registry
63
+ ~/.cargo/git
64
+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
65
+ restore-keys : |
66
+ ${{ runner.os }}-cargo-
67
+
53
68
- name : Install Rust nightly
54
69
uses : dtolnay/rust-toolchain@nightly
55
70
56
- - name : Install audit
71
+ - name : Install cargo- audit
57
72
run : cargo install cargo-audit
58
73
59
74
- name : Run cargo audit
60
- run : cargo install cargo-audit && cargo audit
75
+ run : cargo audit
61
76
62
77
build :
63
78
name : Build project
76
91
- name : Checkout repository
77
92
uses : actions/checkout@v4
78
93
79
- - name : Cache dependencies
94
+ - name : Restore cargo and target cache
80
95
uses : actions/cache@v3
81
96
with :
82
97
path : |
@@ -112,7 +127,7 @@ jobs:
112
127
- name : Checkout repository
113
128
uses : actions/checkout@v4
114
129
115
- - name : Cache dependencies
130
+ - name : Restore cargo and target cache
116
131
uses : actions/cache@v3
117
132
with :
118
133
path : |
0 commit comments