@@ -2,7 +2,7 @@ name: Rust
2
2
3
3
on :
4
4
push :
5
- branches : [ master ]
5
+ branches : [master]
6
6
pull_request :
7
7
types :
8
8
- opened
13
13
14
14
jobs :
15
15
lint :
16
-
17
16
runs-on : ubuntu-latest
18
17
19
18
steps :
20
- - uses : actions/checkout@v2
21
-
22
- - name : Install rust-toolchain
23
- uses : actions-rs/toolchain@v1
24
- with :
25
- profile : minimal
26
- components : rustfmt, clippy
27
-
28
- - name : cargo fmt
29
- uses : actions-rs/cargo@v1
30
- with :
31
- command : fmt
32
- args : --all -- --check
33
-
34
- - name : cargo clippy
35
- uses : actions-rs/cargo@v1
36
- env :
37
- RUSTFLAGS : -D warnings
38
- with :
39
- command : clippy
40
- args : --workspace --all-targets --all-features
19
+ - uses : actions/checkout@v2
41
20
42
- build :
21
+ - name : Install rust-toolchain
22
+ uses : actions-rs/toolchain@v1
23
+ with :
24
+ profile : minimal
25
+ components : rustfmt, clippy
26
+
27
+ - uses : actions/cache@v2
28
+ with :
29
+ path : |
30
+ ~/.cargo/registry
31
+ ~/.cargo/git
32
+ target
33
+ key : ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
34
+ restore-keys : |
35
+ ${{ runner.os }}-cargo-${{ github.job }}-
36
+ ${{ runner.os }}-cargo-
37
+
38
+ - name : cargo fmt
39
+ uses : actions-rs/cargo@v1
40
+ with :
41
+ command : fmt
42
+ args : --all -- --check
43
+
44
+ - name : cargo clippy
45
+ uses : actions-rs/cargo@v1
46
+ env :
47
+ RUSTFLAGS : -D warnings
48
+ with :
49
+ command : clippy
50
+ args : --workspace --all-targets --all-features
43
51
52
+ build :
44
53
runs-on : ubuntu-latest
45
54
46
55
steps :
47
- - uses : actions/checkout@v2
48
- - name : Build (denying warnings)
49
- run : RUSTFLAGS='-D warnings' cargo build --all-targets --all-features --verbose
50
- - name : Run tests
51
- run : cargo test --verbose
56
+ - uses : actions/checkout@v2
57
+
58
+ - name : Install rust-toolchain
59
+ uses : actions-rs/toolchain@v1
60
+ with :
61
+ profile : minimal
62
+
63
+ - uses : actions/cache@v2
64
+ with :
65
+ path : |
66
+ ~/.cargo/registry
67
+ ~/.cargo/git
68
+ target
69
+ key : ${{ runner.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
70
+ restore-keys : |
71
+ ${{ runner.os }}-cargo-${{ github.job }}-
72
+ ${{ runner.os }}-cargo-
73
+
74
+ - name : Build (denying warnings)
75
+ run : RUSTFLAGS='-D warnings' cargo build --all-targets --all-features --verbose
76
+
77
+ - name : Run tests
78
+ run : cargo test --verbose
0 commit comments