Skip to content

Commit fb3df99

Browse files
committed
ci: merge two cache config
1 parent c89d1ed commit fb3df99

12 files changed

+60
-96
lines changed

.github/workflows/centos-fmt-clippy-on-all.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ jobs:
3838
- name: Set environment variables appropriately for the build
3939
run: |
4040
echo "::add-path::$HOME/.cargo/bin"
41-
- name: Cache cargo registry
41+
- name: Cache cargo registry and git trees
4242
uses: actions/cache@v2
4343
with:
44-
path: ~/.cargo/registry
45-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
46-
- name: Cache cargo index
47-
uses: actions/cache@v2
48-
with:
49-
path: ~/.cargo/git
50-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
44+
path: |
45+
~/.cargo/registry
46+
~/.cargo/git
47+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
5148
- name: Cache cargo build
5249
uses: actions/cache@v2
5350
with:

.github/workflows/linux-builds-on-master.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,13 @@ jobs:
5555
run: |
5656
echo "::set-env name=SKIP_TESTS::yes"
5757
if: matrix.run_tests == ''
58-
- name: Cache cargo registry
58+
- name: Cache cargo registry and git trees
5959
uses: actions/cache@v2
6060
with:
61-
path: ~/.cargo/registry
62-
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
63-
- name: Cache cargo git trees
64-
uses: actions/cache@v2
65-
with:
66-
path: ~/.cargo/git
67-
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
61+
path: |
62+
~/.cargo/registry
63+
~/.cargo/git
64+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
6865
- name: Get rustc commit hash
6966
id: cargo-target-cache
7067
run: |

.github/workflows/linux-builds-on-pr.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,13 @@ jobs:
4848
run: |
4949
echo "::set-env name=SKIP_TESTS::yes"
5050
if: matrix.run_tests == ''
51-
- name: Cache cargo registry
51+
- name: Cache cargo registry and git trees
5252
uses: actions/cache@v2
5353
with:
54-
path: ~/.cargo/registry
55-
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
56-
- name: Cache cargo git trees
57-
uses: actions/cache@v2
58-
with:
59-
path: ~/.cargo/git
60-
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
54+
path: |
55+
~/.cargo/registry
56+
~/.cargo/git
57+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
6158
- name: Get rustc commit hash
6259
id: cargo-target-cache
6360
run: |

.github/workflows/linux-builds-on-stable.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,13 @@ jobs:
7676
run: |
7777
echo "::set-env name=SKIP_TESTS::yes"
7878
if: matrix.run_tests == ''
79-
- name: Cache cargo registry
79+
- name: Cache cargo registry and git trees
8080
uses: actions/cache@v2
8181
with:
82-
path: ~/.cargo/registry
83-
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
84-
- name: Cache cargo git trees
85-
uses: actions/cache@v2
86-
with:
87-
path: ~/.cargo/git
88-
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
82+
path: |
83+
~/.cargo/registry
84+
~/.cargo/git
85+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
8986
- name: Get rustc commit hash
9087
id: cargo-target-cache
9188
run: |

.github/workflows/macos-builds-on-all.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,13 @@ jobs:
4141
echo "::add-path::$HOME/.cargo/bin"
4242
echo "::set-env name=TARGET::${{matrix.target}}"
4343
echo "::set-env name=SKIP_TESTS::"
44-
- name: Cache cargo registry
44+
- name: Cache cargo registry and git trees
4545
uses: actions/cache@v2
4646
with:
47-
path: ~/.cargo/registry
48-
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
49-
- name: Cache cargo git trees
50-
uses: actions/cache@v2
51-
with:
52-
path: ~/.cargo/git
53-
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
47+
path: |
48+
~/.cargo/registry
49+
~/.cargo/git
50+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
5451
- name: Get rustc commit hash
5552
id: cargo-target-cache
5653
run: |

.github/workflows/windows-builds-on-master.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,13 @@ jobs:
6363
echo "::add-path::%USERPROFILE%\.cargo\bin"
6464
echo "::set-env name=TARGET::${{matrix.target}}"
6565
echo "::set-env name=SKIP_TESTS::"
66-
- name: Cache cargo registry
66+
- name: Cache cargo registry and git trees
6767
uses: actions/cache@v2
6868
with:
69-
path: ~/.cargo/registry
70-
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
71-
- name: Cache cargo git trees
72-
uses: actions/cache@v2
73-
with:
74-
path: ~/.cargo/git
75-
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
69+
path: |
70+
~/.cargo/registry
71+
~/.cargo/git
72+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
7673
- name: Get rustc commit hash
7774
id: cargo-target-cache
7875
run: |

.github/workflows/windows-builds-on-pr.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,13 @@ jobs:
6060
echo "::add-path::%USERPROFILE%\.cargo\bin"
6161
echo "::set-env name=TARGET::${{matrix.target}}"
6262
echo "::set-env name=SKIP_TESTS::"
63-
- name: Cache cargo registry
63+
- name: Cache cargo registry and git trees
6464
uses: actions/cache@v2
6565
with:
66-
path: ~/.cargo/registry
67-
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
68-
- name: Cache cargo git trees
69-
uses: actions/cache@v2
70-
with:
71-
path: ~/.cargo/git
72-
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
66+
path: |
67+
~/.cargo/registry
68+
~/.cargo/git
69+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
7370
- name: Get rustc commit hash
7471
id: cargo-target-cache
7572
run: |

.github/workflows/windows-builds-on-stable.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,13 @@ jobs:
6363
echo "::add-path::%USERPROFILE%\.cargo\bin"
6464
echo "::set-env name=TARGET::${{matrix.target}}"
6565
echo "::set-env name=SKIP_TESTS::"
66-
- name: Cache cargo registry
66+
- name: Cache cargo registry and git trees
6767
uses: actions/cache@v2
6868
with:
69-
path: ~/.cargo/registry
70-
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
71-
- name: Cache cargo git trees
72-
uses: actions/cache@v2
73-
with:
74-
path: ~/.cargo/git
75-
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
69+
path: |
70+
~/.cargo/registry
71+
~/.cargo/git
72+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
7673
- name: Get rustc commit hash
7774
id: cargo-target-cache
7875
run: |

ci/actions-templates/centos-fmt-clippy-template.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ jobs:
3838
- name: Set environment variables appropriately for the build
3939
run: |
4040
echo "::add-path::$HOME/.cargo/bin"
41-
- name: Cache cargo registry
41+
- name: Cache cargo registry and git trees
4242
uses: actions/cache@v2
4343
with:
44-
path: ~/.cargo/registry
45-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
46-
- name: Cache cargo index
47-
uses: actions/cache@v2
48-
with:
49-
path: ~/.cargo/git
50-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
44+
path: |
45+
~/.cargo/registry
46+
~/.cargo/git
47+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
5148
- name: Cache cargo build
5249
uses: actions/cache@v2
5350
with:

ci/actions-templates/linux-builds-template.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,13 @@ jobs:
8484
run: |
8585
echo "::set-env name=SKIP_TESTS::yes"
8686
if: matrix.run_tests == ''
87-
- name: Cache cargo registry
87+
- name: Cache cargo registry and git trees
8888
uses: actions/cache@v2
8989
with:
90-
path: ~/.cargo/registry
91-
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
92-
- name: Cache cargo git trees
93-
uses: actions/cache@v2
94-
with:
95-
path: ~/.cargo/git
96-
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
90+
path: |
91+
~/.cargo/registry
92+
~/.cargo/git
93+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
9794
- name: Get rustc commit hash
9895
id: cargo-target-cache
9996
run: |

0 commit comments

Comments
 (0)