File tree Expand file tree Collapse file tree 1 file changed +22
-34
lines changed Expand file tree Collapse file tree 1 file changed +22
-34
lines changed Original file line number Diff line number Diff line change 1
1
name : Rust
2
2
3
- on : [push]
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+ branches :
9
+ - main
10
+ schedule :
11
+ - cron : ' 0 0 * * 4'
4
12
5
13
jobs :
6
14
check :
7
15
name : Check
8
16
runs-on : ubuntu-latest
9
17
steps :
10
18
- name : Checkout sources
11
- uses : actions/checkout@v1
19
+ uses : actions/checkout@v3
12
20
13
- - name : Install stable toolchain
14
- uses : actions-rs/toolchain@v1
15
- with :
16
- profile : minimal
17
- toolchain : stable
18
- override : true
21
+ - uses : Swatinem/rust-cache@v2
19
22
20
23
- name : Run cargo check
21
24
uses : actions-rs/cargo@v1
@@ -27,43 +30,28 @@ jobs:
27
30
runs-on : ubuntu-latest
28
31
steps :
29
32
- name : Checkout sources
30
- uses : actions/checkout@v1
33
+ uses : actions/checkout@v3
31
34
32
- - name : Install stable toolchain
33
- uses : actions-rs/toolchain@v1
34
- with :
35
- profile : minimal
36
- toolchain : stable
37
- override : true
35
+ - uses : Swatinem/rust-cache@v2
38
36
39
37
- name : Run cargo test
40
- uses : actions-rs/cargo@v1
41
- with :
42
- command : test
38
+ run : cargo test
43
39
44
40
lints :
45
41
name : Lints
46
42
runs-on : ubuntu-latest
47
43
steps :
48
44
- name : Checkout sources
49
- uses : actions/checkout@v1
45
+ uses : actions/checkout@v3
50
46
51
- - name : Install stable toolchain
52
- uses : actions-rs/toolchain@v1
53
- with :
54
- profile : minimal
55
- toolchain : stable
56
- override : true
57
- components : rustfmt, clippy
47
+ - uses : Swatinem/rust-cache@v2
58
48
59
49
- name : Run cargo fmt
60
- uses : actions-rs/cargo@v1
61
- with :
62
- command : fmt
63
- args : --all -- --check
50
+ run : |
51
+ rustup component add rustfmt
52
+ cargo fmt --all -- --check
64
53
65
54
- name : Run cargo clippy
66
- uses : actions-rs/cargo@v1
67
- with :
68
- command : clippy
69
- args : -- -D warnings
55
+ run : |
56
+ rustup component add clippy
57
+ cargo clippy -- -D warnings
You can’t perform that action at this time.
0 commit comments