@@ -13,15 +13,16 @@ jobs:
13
13
steps :
14
14
- uses : actions/checkout@v3
15
15
- uses : actions/cache@v3
16
+ id : cargo-cache
16
17
with :
17
18
path : |
18
19
~/.cargo/bin/
19
20
~/.cargo/registry/index/
20
21
~/.cargo/registry/cache/
21
22
~/.cargo/git/db/
22
- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
23
+ key : ${{ runner.os }}-cargo-dependencies- ${{ hashFiles('**/Cargo.lock') }}
23
24
restore-keys : |
24
- ${{ runner.os }}-cargo
25
+ ${{ runner.os }}-cargo-dependencies
25
26
- uses : actions-rs/toolchain@v1
26
27
with :
27
28
toolchain : 1.59.0
40
41
with :
41
42
command : test
42
43
args : --all --verbose --exclude rage --all-features
44
+ - name : Autoclean the cache
45
+ if : steps.cargo-cache.outputs.cache-hit != 'true'
46
+ run :
47
+ cargo install --no-default-features --features ci-autoclean cargo-cache
48
+ cargo-cache
43
49
44
50
build :
45
51
name : Build target ${{ matrix.target }}
@@ -52,15 +58,16 @@ jobs:
52
58
steps :
53
59
- uses : actions/checkout@v3
54
60
- uses : actions/cache@v3
61
+ id : cargo-cache
55
62
with :
56
63
path : |
57
64
~/.cargo/bin/
58
65
~/.cargo/registry/index/
59
66
~/.cargo/registry/cache/
60
67
~/.cargo/git/db/
61
- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
68
+ key : ${{ runner.os }}-cargo-dependencies- ${{ hashFiles('**/Cargo.lock') }}
62
69
restore-keys : |
63
- ${{ runner.os }}-cargo
70
+ ${{ runner.os }}-cargo-dependencies
64
71
- uses : actions-rs/toolchain@v1
65
72
with :
66
73
toolchain : 1.59.0
74
81
- name : Build for target
75
82
working-directory : ./age
76
83
run : cargo build --verbose --no-default-features --target ${{ matrix.target }}
84
+ - name : Autoclean the cache
85
+ if : steps.cargo-cache.outputs.cache-hit != 'true'
86
+ run :
87
+ cargo install --no-default-features --features ci-autoclean cargo-cache
88
+ cargo-cache
77
89
78
90
bitrot :
79
91
name : Bitrot
@@ -82,15 +94,16 @@ jobs:
82
94
steps :
83
95
- uses : actions/checkout@v3
84
96
- uses : actions/cache@v3
97
+ id : cargo-cache
85
98
with :
86
99
path : |
87
100
~/.cargo/bin/
88
101
~/.cargo/registry/index/
89
102
~/.cargo/registry/cache/
90
103
~/.cargo/git/db/
91
- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
104
+ key : ${{ runner.os }}-cargo-dependencies- ${{ hashFiles('**/Cargo.lock') }}
92
105
restore-keys : |
93
- ${{ runner.os }}-cargo
106
+ ${{ runner.os }}-cargo-dependencies
94
107
- uses : actions-rs/toolchain@v1
95
108
with :
96
109
toolchain : 1.59.0
@@ -102,6 +115,11 @@ jobs:
102
115
with :
103
116
command : check
104
117
args : --tests --examples --benches --all-features
118
+ - name : Autoclean the cache
119
+ if : steps.cargo-cache.outputs.cache-hit != 'true'
120
+ run :
121
+ cargo install --no-default-features --features ci-autoclean cargo-cache
122
+ cargo-cache
105
123
106
124
clippy :
107
125
name : Clippy (1.59.0)
@@ -110,15 +128,16 @@ jobs:
110
128
steps :
111
129
- uses : actions/checkout@v3
112
130
- uses : actions/cache@v3
131
+ id : cargo-cache
113
132
with :
114
133
path : |
115
134
~/.cargo/bin/
116
135
~/.cargo/registry/index/
117
136
~/.cargo/registry/cache/
118
137
~/.cargo/git/db/
119
- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
138
+ key : ${{ runner.os }}-cargo-dependencies- ${{ hashFiles('**/Cargo.lock') }}
120
139
restore-keys : |
121
- ${{ runner.os }}-cargo
140
+ ${{ runner.os }}-cargo-dependencies
122
141
- uses : actions-rs/toolchain@v1
123
142
with :
124
143
toolchain : 1.59.0
@@ -132,6 +151,11 @@ jobs:
132
151
name : Clippy (1.59.0)
133
152
token : ${{ secrets.GITHUB_TOKEN }}
134
153
args : --all-features --all-targets -- -D warnings
154
+ - name : Autoclean the cache
155
+ if : steps.cargo-cache.outputs.cache-hit != 'true'
156
+ run :
157
+ cargo install --no-default-features --features ci-autoclean cargo-cache
158
+ cargo-cache
135
159
136
160
codecov :
137
161
name : Code coverage
@@ -140,15 +164,16 @@ jobs:
140
164
steps :
141
165
- uses : actions/checkout@v3
142
166
- uses : actions/cache@v3
167
+ id : cargo-cache
143
168
with :
144
169
path : |
145
170
~/.cargo/bin/
146
171
~/.cargo/registry/index/
147
172
~/.cargo/registry/cache/
148
173
~/.cargo/git/db/
149
- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
174
+ key : ${{ runner.os }}-cargo-dependencies- ${{ hashFiles('**/Cargo.lock') }}
150
175
restore-keys : |
151
- ${{ runner.os }}-cargo
176
+ ${{ runner.os }}-cargo-dependencies
152
177
- uses : actions-rs/toolchain@v1
153
178
with :
154
179
toolchain : stable
@@ -164,6 +189,11 @@ jobs:
164
189
165
190
with :
166
191
fail_ci_if_error : true
192
+ - name : Autoclean the cache
193
+ if : steps.cargo-cache.outputs.cache-hit != 'true'
194
+ run :
195
+ cargo install --no-default-features --features ci-autoclean cargo-cache
196
+ cargo-cache
167
197
168
198
doc-links :
169
199
name : Intra-doc links
@@ -172,15 +202,15 @@ jobs:
172
202
steps :
173
203
- uses : actions/checkout@v3
174
204
- uses : actions/cache@v3
205
+ id : cargo-cache
175
206
with :
176
207
path : |
177
208
~/.cargo/bin/
178
209
~/.cargo/registry/index/
179
210
~/.cargo/registry/cache/
180
211
~/.cargo/git/db/
181
- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
182
- restore-keys : |
183
- ${{ runner.os }}-cargo
212
+ key : ${{ runner.os }}-cargo-dependencies-${{ hashFiles('**/Cargo.lock') }}
213
+ ${{ runner.os }}-cargo-dependencies
184
214
- uses : actions-rs/toolchain@v1
185
215
with :
186
216
toolchain : 1.59.0
@@ -197,6 +227,12 @@ jobs:
197
227
with :
198
228
command : doc
199
229
args : --all --exclude rage --all-features --document-private-items
230
+ - name : Autoclean the cache
231
+ if : steps.cargo-cache.outputs.cache-hit != 'true'
232
+ run :
233
+ cargo install --no-default-features --features ci-autoclean cargo-cache
234
+ cargo-cache
235
+
200
236
201
237
fmt :
202
238
name : Rustfmt
0 commit comments