@@ -22,26 +22,7 @@ jobs:
2222 toolchain: stable
2323 override: true
2424
25− - name: Cache cargo registry
26− uses: actions/cache@v3
27− with:
28− path: ~/.cargo/registry
29− key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
30− restore-keys: ${{ runner.os }}-v2-cargo-registry-
31−
32− - name: Cache cargo index
33− uses: actions/cache@v3
34− with:
35− path: ~/.cargo/git
36− key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
37− restore-keys: ${{ runner.os }}-v2-cargo-index-
38−
39− - name: Cache cargo target dir
40− uses: actions/cache@v3
41− with:
42− path: target
43− key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
44− restore-keys: ${{ runner.os }}-v2-cargo-build-target-
25+ - uses: Swatinem/rust-cache@v1
4526
4627 - name: Run cargo check
4728 uses: actions-rs/cargo@v1
@@ -62,26 +43,7 @@ jobs:
6243 toolchain: ${{ matrix.rust }}
6344 override: true
6445
65− - name: Cache cargo registry
66− uses: actions/cache@v3
67− with:
68− path: ~/.cargo/registry
69− key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
70− restore-keys: ${{ runner.os }}-v2-cargo-registry-
71−
72− - name: Cache cargo index
73− uses: actions/cache@v3
74− with:
75− path: ~/.cargo/git
76− key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
77− restore-keys: ${{ runner.os }}-v2-cargo-index-
78−
79− - name: Cache cargo target dir
80− uses: actions/cache@v3
81− with:
82− path: target
83− key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
84− restore-keys: ${{ runner.os }}-v2-cargo-build-target-
46+ - uses: Swatinem/rust-cache@v1
8547
8648 - name: Copy minimal languages config
8749 run: cp .github/workflows/languages.toml ./languages.toml
@@ -119,26 +81,7 @@ jobs:
11981 override: true
12082 components: rustfmt, clippy
12183
122− - name: Cache cargo registry
123− uses: actions/cache@v3
124− with:
125− path: ~/.cargo/registry
126− key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
127− restore-keys: ${{ runner.os }}-v2-cargo-registry-
128−
129− - name: Cache cargo index
130− uses: actions/cache@v3
131− with:
132− path: ~/.cargo/git
133− key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
134− restore-keys: ${{ runner.os }}-v2-cargo-index-
135−
136− - name: Cache cargo target dir
137− uses: actions/cache@v3
138− with:
139− path: target
140− key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
141− restore-keys: ${{ runner.os }}-v2-cargo-build-target-
84+ - uses: Swatinem/rust-cache@v1
14285
14386 - name: Run cargo fmt
14487 uses: actions-rs/cargo@v1
@@ -166,26 +109,7 @@ jobs:
166109 toolchain: stable
167110 override: true
168111
169− - name: Cache cargo registry
170− uses: actions/cache@v3
171− with:
172− path: ~/.cargo/registry
173− key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
174− restore-keys: ${{ runner.os }}-v2-cargo-registry-
175−
176− - name: Cache cargo index
177− uses: actions/cache@v3
178− with:
179− path: ~/.cargo/git
180− key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
181− restore-keys: ${{ runner.os }}-v2-cargo-index-
182−
183− - name: Cache cargo target dir
184− uses: actions/cache@v3
185− with:
186− path: target
187− key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
188− restore-keys: ${{ runner.os }}-v2-cargo-build-target-
112+ - uses: Swatinem/rust-cache@v1
189113
190114 - name: Generate docs
191115 uses: actions-rs/cargo@v1