@@ -69,46 +69,23 @@ jobs:
69
69
runs-on : ubuntu-20.04
70
70
71
71
env :
72
- CARGO_INCREMENTAL : 0
73
72
RUSTFLAGS : " -D warnings"
74
73
75
74
steps :
76
75
- uses : actions/checkout@v2
77
76
78
- # Current size as of 2021-02-15: ~105 MB
79
- - name : Cache cargo registry and git deps
80
- uses : actions/cache@v2.1.6
81
- with :
82
- path : |
83
- ~/.cargo/registry/cache
84
- ~/.cargo/registry/index
85
- ~/.cargo/git/db
86
- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
87
- restore-keys : |
88
- ${{ runner.os }}-cargo-
89
-
90
77
- name : Install Rust
91
78
run : |
92
79
rustup set profile minimal
93
80
# Pin to older version until a clippy regression is fixed
94
81
rustup update 1.54.0
95
82
rustup default 1.54.0
96
83
97
- - id : rustc
98
- run :
99
- echo "::set-output name=version::$(rustc -V)"
100
-
101
- - name : Cache cargo build
102
- uses : actions/cache@v2.1.6
103
- with :
104
- path : target
105
- key : v2-${{ runner.os }}-cargo-clippy-${{ steps.rustc.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
106
- restore-keys : |
107
- v2-${{ runner.os }}-cargo-clippy-${{ steps.rustc.outputs.version }}-
108
-
109
84
- run : rustup component add rustfmt
110
85
- run : rustup component add clippy
111
86
87
+ - uses : Swatinem/rust-cache@v1.3.0
88
+
112
89
- run : cargo fmt -- --check
113
90
- run : cargo clippy --all-targets --all-features --all
114
91
@@ -127,7 +104,6 @@ jobs:
127
104
RUST_BACKTRACE : 1
128
105
DATABASE_URL : postgres://postgres:postgres@localhost/cargo_registry_test
129
106
TEST_DATABASE_URL : postgres://postgres:postgres@localhost/cargo_registry_test
130
- CARGO_INCREMENTAL : 0
131
107
RUSTFLAGS : " -D warnings"
132
108
MALLOC_CONF : " background_thread:true,abort_conf:true,abort:true,junk:true"
133
109
@@ -161,29 +137,6 @@ jobs:
161
137
fi
162
138
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
163
139
164
- # Cache `diesel` binary
165
- #
166
- # The other binaries (like `rustc`) will be overwritten by rustup.
167
- #
168
- # Current size as of 2021-02-15: ~15 MB
169
- - name : Cache cargo binaries
170
- uses : actions/cache@v2.1.6
171
- with :
172
- path : ~/.cargo/bin
173
- key : ${{ runner.os }}-cargo-bin-${{ matrix.rust }}-${{ hashFiles('.diesel_version') }}-v3
174
-
175
- # Current size as of 2021-02-15: ~105 MB
176
- - name : Cache cargo registry and git deps
177
- uses : actions/cache@v2.1.6
178
- with :
179
- path : |
180
- ~/.cargo/registry/cache
181
- ~/.cargo/registry/index
182
- ~/.cargo/git/db
183
- key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
184
- restore-keys : |
185
- ${{ runner.os }}-cargo-
186
-
187
140
- name : Install ${{ matrix.rust }} Rust
188
141
run : |
189
142
if [[ ! -d "$HOME/.cargo" || ! -d "$HOME/.rustup" ]]; then
@@ -194,27 +147,16 @@ jobs:
194
147
rustup update ${{ matrix.rust }}
195
148
rustup default ${{ matrix.rust }}
196
149
197
- - id : rustc
198
- run :
199
- echo "::set-output name=version::$(rustc -V)"
200
-
201
- # Current size as of 2021-02-12: ~325 MB
202
- - name : Cache cargo build
203
- uses : actions/cache@v2.1.6
204
- with :
205
- path : target
206
- key : v2-${{ runner.os }}-cargo-build-target-${{ steps.rustc.outputs.version }}-${{ hashFiles('**/Cargo.lock') }}
207
- restore-keys : |
208
- v2-${{ runner.os }}-cargo-build-target-${{ steps.rustc.outputs.version }}-
150
+ - uses : Swatinem/rust-cache@v1.3.0
209
151
210
152
- name : Setup database
211
153
run : |
212
- which diesel || cargo install diesel_cli --vers $(cat .diesel_version) --no-default-features --features postgres --debug
154
+ cargo install diesel_cli --vers $(cat .diesel_version) --no-default-features --features postgres --debug
213
155
diesel database setup --locked-schema
214
156
215
157
- name : Install cargo-tarpaulin
216
158
if : matrix.rust == 'stable'
217
- run : which cargo-tarpaulin || cargo install cargo-tarpaulin --version ~0.18.0-alpha.3
159
+ run : cargo install cargo-tarpaulin --version ~0.18.0-alpha.3
218
160
219
161
- name : Run tests (with coverage report)
220
162
if : matrix.rust == 'stable'
@@ -224,9 +166,6 @@ jobs:
224
166
if : matrix.rust != 'stable'
225
167
run : cargo test --workspace
226
168
227
- - name : Prune unnecessary cache
228
- run : script/ci/prune-cache.sh
229
-
230
169
231
170
# These jobs doesn't actually test anything, but they're only used to tell
232
171
# bors the build completed, as there is no practical way to detect when a
0 commit comments