@@ -47,18 +47,10 @@ jobs:
4747 components : rustfmt, clippy
4848
4949 - name : Cache cargo registry and build
50- uses : actions/ cache@v4
50+ uses : Swatinem/rust- cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
5151 with :
52- path : |
53- ~/.cargo/bin/
54- ~/.cargo/registry/index/
55- ~/.cargo/registry/cache/
56- ~/.cargo/git/db/
57- target/
58- key : ${{ runner.os }}-cargo-quick-${{ hashFiles('**/Cargo.lock') }}
59- restore-keys : |
60- ${{ runner.os }}-cargo-quick-
61- ${{ runner.os }}-cargo-
52+ prefix-key : " v1-rust"
53+ shared-key : " quick"
6254
6355 - name : Check formatting
6456 run : cargo fmt --all -- --check
@@ -84,19 +76,10 @@ jobs:
8476 toolchain : stable
8577
8678 - name : Cache cargo registry and build
87- uses : actions/ cache@v4
79+ uses : Swatinem/rust- cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
8880 with :
89- path : |
90- ~/.cargo/bin/
91- ~/.cargo/registry/index/
92- ~/.cargo/registry/cache/
93- ~/.cargo/git/db/
94- target/
95- key : ${{ runner.os }}-cargo-test-${{ matrix.package }}-${{ hashFiles('**/Cargo.lock') }}
96- restore-keys : |
97- ${{ runner.os }}-cargo-test-${{ matrix.package }}-
98- ${{ runner.os }}-cargo-test-
99- ${{ runner.os }}-cargo-
81+ prefix-key : " v1-rust"
82+ shared-key : " test-${{ matrix.package }}"
10083
10184 - name : Run unit tests
10285 run : cargo test --package ${{ matrix.package }} --lib --all-features
@@ -115,18 +98,10 @@ jobs:
11598 toolchain : stable
11699
117100 - name : Cache cargo registry and build
118- uses : actions/ cache@v4
101+ uses : Swatinem/rust- cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
119102 with :
120- path : |
121- ~/.cargo/bin/
122- ~/.cargo/registry/index/
123- ~/.cargo/registry/cache/
124- ~/.cargo/git/db/
125- target/
126- key : ${{ runner.os }}-cargo-integration-${{ hashFiles('**/Cargo.lock') }}
127- restore-keys : |
128- ${{ runner.os }}-cargo-integration-
129- ${{ runner.os }}-cargo-
103+ prefix-key : " v1-rust"
104+ shared-key : " integration"
130105
131106 - name : Run integration tests
132107 run : cargo test --workspace --test '*' --all-features
@@ -156,18 +131,10 @@ jobs:
156131 toolchain : stable
157132
158133 - name : Cache cargo registry and build
159- uses : actions/ cache@v4
134+ uses : Swatinem/rust- cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
160135 with :
161- path : |
162- ~/.cargo/bin/
163- ~/.cargo/registry/index/
164- ~/.cargo/registry/cache/
165- ~/.cargo/git/db/
166- target/
167- key : ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
168- restore-keys : |
169- ${{ runner.os }}-cargo-build-
170- ${{ runner.os }}-cargo-
136+ prefix-key : " v1-rust"
137+ shared-key : " build"
171138
172139 - name : Build binary
173140 run : cargo build --release --bin redisctl
@@ -192,18 +159,10 @@ jobs:
192159 toolchain : stable
193160
194161 - name : Cache cargo registry and build
195- uses : actions/ cache@v4
162+ uses : Swatinem/rust- cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
196163 with :
197- path : |
198- ~/.cargo/bin/
199- ~/.cargo/registry/index/
200- ~/.cargo/registry/cache/
201- ~/.cargo/git/db/
202- target/
203- key : ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}
204- restore-keys : |
205- ${{ runner.os }}-cargo-coverage-
206- ${{ runner.os }}-cargo-
164+ prefix-key : " v1-rust"
165+ shared-key : " coverage"
207166
208167 - name : Install tarpaulin
209168 uses : taiki-e/install-action@v2
0 commit comments