@@ -2,9 +2,9 @@ name: Rust CI
2
2
3
3
on :
4
4
push :
5
- branches : [main]
5
+ branches : [ main ]
6
6
pull_request :
7
- branches : [main]
7
+ branches : [ main ]
8
8
9
9
env :
10
10
CARGO_TERM_COLOR : always
@@ -15,29 +15,33 @@ jobs:
15
15
strategy :
16
16
fail-fast : false
17
17
matrix :
18
- rust_version : [stable, beta, nightly, 1.73.0, "stable minus 1 release", "stable minus 2 releases"]
18
+ rust_version : [ stable, beta, nightly, 1.73.0, "stable minus 1 release", "stable minus 2 releases" ]
19
19
steps :
20
20
- uses : actions/checkout@v4
21
21
- uses : dtolnay/rust-toolchain@master
22
22
with :
23
23
toolchain : ${{ matrix.rust_version }}
24
- - name : Cache cargo registry
25
- uses : actions/cache@v3
26
- with :
27
- path : ~/.cargo/registry
28
- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
29
- - name : Cache cargo index
30
- uses : actions/cache@v3
24
+ - name : Cache cargo
25
+ uses : actions/cache@v4
31
26
with :
32
- path : ~/.cargo/git
33
- key : ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
27
+ path : ~/.cargo/
28
+ key : ${{ runner.os }}-cargo-registry-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }}
29
+ restore-keys : |
30
+ ${{ runner.os }}-cargo-registry-${{ matrix.rust_version }}-
34
31
- name : Cache cargo build
35
32
uses : actions/cache@v3
36
33
with :
37
- path : target
38
- key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
34
+ path : ~/work/gosub-engine/gosub-engine/target
35
+ key : ${{ runner.os }}-cargo-target-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }}
36
+ restore-keys : |
37
+ ${{ runner.os }}-cargo-target-${{ matrix.rust_version }}-
39
38
- name : Build
40
39
run : cargo build --verbose --all --all-features
40
+ - name : Clean
41
+ run : |
42
+ cargo install cargo-sweep
43
+ cargo sweep --installed
44
+ cargo sweep --time 7
41
45
42
46
test :
43
47
runs-on : ubuntu-latest
@@ -52,21 +56,20 @@ jobs:
52
56
- uses : dtolnay/rust-toolchain@master
53
57
with :
54
58
toolchain : ${{ matrix.rust_version }}
55
- - name : Cache cargo registry
56
- uses : actions/cache@v3
57
- with :
58
- path : ~/.cargo/registry
59
- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
60
- - name : Cache cargo index
61
- uses : actions/cache@v3
59
+ - name : Cache cargo
60
+ uses : actions/cache@v4
62
61
with :
63
- path : ~/.cargo/git
64
- key : ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
62
+ path : ~/.cargo
63
+ key : ${{ runner.os }}-cargo-registry-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }}
64
+ restore-keys : |
65
+ ${{ runner.os }}-cargo-registry-${{ matrix.rust_version }}-
65
66
- name : Cache cargo build
66
67
uses : actions/cache@v3
67
68
with :
68
- path : target
69
- key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
69
+ path : ~/work/gosub-engine/gosub-engine/target
70
+ key : ${{ runner.os }}-cargo-target-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }}
71
+ restore-keys : |
72
+ ${{ runner.os }}-cargo-target-${{ matrix.rust_version }}-
70
73
- name : Run tests
71
74
run : cargo test --verbose --all --no-fail-fast --all-features --all-targets
72
75
@@ -81,21 +84,20 @@ jobs:
81
84
- uses : dtolnay/rust-toolchain@master
82
85
with :
83
86
toolchain : ${{ matrix.rust_version }}
84
- - name : Cache cargo registry
85
- uses : actions/cache@v3
86
- with :
87
- path : ~/.cargo/registry
88
- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
89
- - name : Cache cargo index
90
- uses : actions/cache@v3
87
+ - name : Cache cargo
88
+ uses : actions/cache@v4
91
89
with :
92
- path : ~/.cargo/git
93
- key : ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
90
+ path : ~/.cargo
91
+ key : ${{ runner.os }}-cargo-registry-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }}
92
+ restore-keys : |
93
+ ${{ runner.os }}-cargo-registry-${{ matrix.rust_version }}-
94
94
- name : Cache cargo build
95
95
uses : actions/cache@v3
96
96
with :
97
- path : target
98
- key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust_version }}
97
+ path : ~/work/gosub-engine/gosub-engine/target
98
+ key : ${{ runner.os }}-cargo-target-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }}
99
+ restore-keys : |
100
+ ${{ runner.os }}-cargo-target-${{ matrix.rust_version }}-
99
101
- name : Run Clippy
100
102
run : cargo clippy --all --tests -- -D warnings
101
103
@@ -104,20 +106,19 @@ jobs:
104
106
steps :
105
107
- uses : actions/checkout@v4
106
108
- uses : dtolnay/rust-toolchain@stable
107
- - name : Cache cargo registry
108
- uses : actions/cache@v3
109
- with :
110
- path : ~/.cargo/registry
111
- key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-stable
112
- - name : Cache cargo index
113
- uses : actions/cache@v3
109
+ - name : Cache cargo
110
+ uses : actions/cache@v4
114
111
with :
115
- path : ~/.cargo/git
116
- key : ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}-stable
112
+ path : ~/.cargo
113
+ key : ${{ runner.os }}-cargo-registry-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }}
114
+ restore-keys : |
115
+ ${{ runner.os }}-cargo-registry-${{ matrix.rust_version }}-
117
116
- name : Cache cargo build
118
117
uses : actions/cache@v3
119
118
with :
120
- path : target
121
- key : ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}-stable
119
+ path : ~/work/gosub-engine/gosub-engine/target
120
+ key : ${{ runner.os }}-cargo-target-${{ matrix.rust_version }}-${{ hashFiles('**/Cargo.lock') }}
121
+ restore-keys : |
122
+ ${{ runner.os }}-cargo-target-${{ matrix.rust_version }}-
122
123
- name : Run fmt
123
124
run : cargo fmt --check --all
0 commit comments