Skip to content

Commit 79ecb67

Browse files
authored
Merge pull request #1319 from syphar/faster-ci
CI: use rust-cache action for faster CI
2 parents da87867 + c38726c commit 79ecb67

File tree

1 file changed

+4
-66
lines changed

1 file changed

+4
-66
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,9 @@ jobs:
1717
with:
1818
toolchain: stable
1919
override: true
20-
- uses: actions-rs/cargo@v1
21-
with:
22-
command: install
23-
args: cargo-sweep
2420

25-
- name: Cache directories
26-
uses: actions/cache@v2
27-
with:
28-
path: |
29-
~/.cargo/registry
30-
~/.cargo/bin
31-
~/.cargo/git
32-
key: cargo-test-dirs-${{ hashFiles('**/Cargo.lock') }}
33-
restore-keys: cargo-test-dirs-
34-
- name: Cache build
35-
uses: actions/cache@v2
36-
with:
37-
path: target
38-
key: cargo-test-build-${{ steps.install.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
39-
restore-keys: |
40-
cargo-test-build-${{ steps.install.outputs.rustc_hash }}-
41-
cargo-test-build-
42-
43-
- name: Register artifacts
44-
uses: actions-rs/cargo@v1
45-
with:
46-
command: sweep
47-
args: --stamp
21+
- name: restore build & cargo cache
22+
uses: Swatinem/rust-cache@v1
4823

4924
- name: Launch postgres and min.io
5025
run: |
@@ -76,12 +51,6 @@ jobs:
7651
- name: Clean up the database
7752
run: docker-compose down --volumes
7853

79-
- name: Clean unused artifacts
80-
uses: actions-rs/cargo@v1
81-
with:
82-
command: sweep
83-
args: --file
84-
8554
fmt:
8655
name: Rustfmt
8756
runs-on: ubuntu-latest
@@ -112,42 +81,11 @@ jobs:
11281
toolchain: stable
11382
override: true
11483
components: clippy
115-
- uses: actions-rs/cargo@v1
116-
with:
117-
command: install
118-
args: cargo-sweep
11984

120-
- name: Cache directories
121-
uses: actions/cache@v2
122-
with:
123-
path: |
124-
~/.cargo/registry
125-
~/.cargo/bin
126-
~/.cargo/git
127-
key: cargo-clippy-dirs-${{ hashFiles('**/Cargo.lock') }}
128-
restore-keys: cargo-clippy-dirs-
129-
- name: Cache build
130-
uses: actions/cache@v2
131-
with:
132-
path: target
133-
key: cargo-clippy-${{ steps.install.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
134-
restore-keys: |
135-
cargo-clippy-${{ steps.install.outputs.rustc_hash }}-
136-
cargo-clippy-
137-
138-
- name: Register artifacts
139-
uses: actions-rs/cargo@v1
140-
with:
141-
command: sweep
142-
args: --stamp
85+
- name: restore build & cargo cache
86+
uses: Swatinem/rust-cache@v1
14387

14488
- uses: actions-rs/cargo@v1
14589
with:
14690
command: clippy
14791
args: --all-targets --workspace --locked -- -D warnings
148-
149-
- name: Clean unused artifacts
150-
uses: actions-rs/cargo@v1
151-
with:
152-
command: sweep
153-
args: --file

0 commit comments

Comments
 (0)