Skip to content

Commit 01fb32f

Browse files
authored
Merge pull request #2193 from kinnison/tweak-caching-on-ci
Tweak caching on ci
2 parents 3008ac7 + 8245109 commit 01fb32f

10 files changed

+80
-40
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ jobs:
5454
uses: actions/cache@v1
5555
with:
5656
path: ~/.cargo/registry
57-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
58-
- name: Cache cargo index
57+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
58+
- name: Cache cargo git trees
5959
uses: actions/cache@v1
6060
with:
6161
path: ~/.cargo/git
62-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
62+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
6363
- name: Cache cargo build
6464
uses: actions/cache@v1
6565
with:
6666
path: target
67-
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
67+
key: ${{ runner.os }}-cargo-build-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
6868
- name: Install Rustup using ./rustup-init.sh
6969
run: |
7070
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
@@ -130,3 +130,7 @@ jobs:
130130
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
131131
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
132132
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
133+
- name: Clear the cargo caches
134+
run: |
135+
cargo install cargo-cache --no-default-features --features ci-autoclean
136+
cargo-cache

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ jobs:
4949
uses: actions/cache@v1
5050
with:
5151
path: ~/.cargo/registry
52-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
53-
- name: Cache cargo index
52+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
53+
- name: Cache cargo git trees
5454
uses: actions/cache@v1
5555
with:
5656
path: ~/.cargo/git
57-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
57+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
5858
- name: Cache cargo build
5959
uses: actions/cache@v1
6060
with:
6161
path: target
62-
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
62+
key: ${{ runner.os }}-cargo-build-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
6363
- name: Install Rustup using ./rustup-init.sh
6464
run: |
6565
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
@@ -125,3 +125,7 @@ jobs:
125125
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
126126
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
127127
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
128+
- name: Clear the cargo caches
129+
run: |
130+
cargo install cargo-cache --no-default-features --features ci-autoclean
131+
cargo-cache

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ jobs:
6868
uses: actions/cache@v1
6969
with:
7070
path: ~/.cargo/registry
71-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
72-
- name: Cache cargo index
71+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
72+
- name: Cache cargo git trees
7373
uses: actions/cache@v1
7474
with:
7575
path: ~/.cargo/git
76-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
76+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
7777
- name: Cache cargo build
7878
uses: actions/cache@v1
7979
with:
8080
path: target
81-
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
81+
key: ${{ runner.os }}-cargo-build-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
8282
- name: Install Rustup using ./rustup-init.sh
8383
run: |
8484
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
@@ -144,3 +144,7 @@ jobs:
144144
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
145145
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
146146
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
147+
- name: Clear the cargo caches
148+
run: |
149+
cargo install cargo-cache --no-default-features --features ci-autoclean
150+
cargo-cache

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ jobs:
4545
uses: actions/cache@v1
4646
with:
4747
path: ~/.cargo/registry
48-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
49-
- name: Cache cargo index
48+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
49+
- name: Cache cargo git trees
5050
uses: actions/cache@v1
5151
with:
5252
path: ~/.cargo/git
53-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
53+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
5454
- name: Cache cargo build
5555
uses: actions/cache@v1
5656
with:
5757
path: target
58-
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
58+
key: ${{ runner.os }}-cargo-build-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
5959
- name: Install Rustup using ./rustup-init.sh
6060
run: |
6161
sh ./rustup-init.sh --default-toolchain=stable --profile=minimal -y
@@ -77,3 +77,7 @@ jobs:
7777
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
7878
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
7979
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
80+
- name: Clear the cargo caches
81+
run: |
82+
cargo install cargo-cache --no-default-features --features ci-autoclean
83+
cargo-cache

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ jobs:
6767
uses: actions/cache@v1
6868
with:
6969
path: ~/.cargo/registry
70-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
71-
- name: Cache cargo index
70+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
71+
- name: Cache cargo git trees
7272
uses: actions/cache@v1
7373
with:
7474
path: ~/.cargo/git
75-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
75+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
7676
- name: Cache cargo build
7777
uses: actions/cache@v1
7878
with:
7979
path: target
80-
key: ${{ runner.os }}-cargo-build-static-crt-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
80+
key: ${{ runner.os }}-cargo-build-static-crt-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
8181
- name: Install Rustup using win.rustup.rs
8282
run: |
8383
# Disable the download progress bar which can cause perf issues
@@ -172,3 +172,7 @@ jobs:
172172
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
173173
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
174174
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
175+
- name: Clear the cargo caches
176+
run: |
177+
cargo install cargo-cache --no-default-features --features ci-autoclean
178+
cargo-cache

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ jobs:
6464
uses: actions/cache@v1
6565
with:
6666
path: ~/.cargo/registry
67-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
68-
- name: Cache cargo index
67+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
68+
- name: Cache cargo git trees
6969
uses: actions/cache@v1
7070
with:
7171
path: ~/.cargo/git
72-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
72+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
7373
- name: Cache cargo build
7474
uses: actions/cache@v1
7575
with:
7676
path: target
77-
key: ${{ runner.os }}-cargo-build-static-crt-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
77+
key: ${{ runner.os }}-cargo-build-static-crt-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
7878
- name: Install Rustup using win.rustup.rs
7979
run: |
8080
# Disable the download progress bar which can cause perf issues
@@ -169,3 +169,7 @@ jobs:
169169
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
170170
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
171171
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
172+
- name: Clear the cargo caches
173+
run: |
174+
cargo install cargo-cache --no-default-features --features ci-autoclean
175+
cargo-cache

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ jobs:
6767
uses: actions/cache@v1
6868
with:
6969
path: ~/.cargo/registry
70-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
71-
- name: Cache cargo index
70+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
71+
- name: Cache cargo git trees
7272
uses: actions/cache@v1
7373
with:
7474
path: ~/.cargo/git
75-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
75+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
7676
- name: Cache cargo build
7777
uses: actions/cache@v1
7878
with:
7979
path: target
80-
key: ${{ runner.os }}-cargo-build-static-crt-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
80+
key: ${{ runner.os }}-cargo-build-static-crt-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
8181
- name: Install Rustup using win.rustup.rs
8282
run: |
8383
# Disable the download progress bar which can cause perf issues
@@ -172,3 +172,7 @@ jobs:
172172
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
173173
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
174174
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
175+
- name: Clear the cargo caches
176+
run: |
177+
cargo install cargo-cache --no-default-features --features ci-autoclean
178+
cargo-cache

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ jobs:
7676
uses: actions/cache@v1
7777
with:
7878
path: ~/.cargo/registry
79-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
80-
- name: Cache cargo index
79+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
80+
- name: Cache cargo git trees
8181
uses: actions/cache@v1
8282
with:
8383
path: ~/.cargo/git
84-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
84+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
8585
- name: Cache cargo build
8686
uses: actions/cache@v1
8787
with:
8888
path: target
89-
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
89+
key: ${{ runner.os }}-cargo-build-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
9090
- name: Install Rustup using ./rustup-init.sh
9191
run: |
9292
sh ./rustup-init.sh --default-toolchain=none --profile=minimal -y
@@ -152,3 +152,7 @@ jobs:
152152
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
153153
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
154154
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
155+
- name: Clear the cargo caches
156+
run: |
157+
cargo install cargo-cache --no-default-features --features ci-autoclean
158+
cargo-cache

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ jobs:
4545
uses: actions/cache@v1
4646
with:
4747
path: ~/.cargo/registry
48-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
49-
- name: Cache cargo index
48+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
49+
- name: Cache cargo git trees
5050
uses: actions/cache@v1
5151
with:
5252
path: ~/.cargo/git
53-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
53+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
5454
- name: Cache cargo build
5555
uses: actions/cache@v1
5656
with:
5757
path: target
58-
key: ${{ runner.os }}-cargo-build-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
58+
key: ${{ runner.os }}-cargo-build-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
5959
- name: Install Rustup using ./rustup-init.sh
6060
run: |
6161
sh ./rustup-init.sh --default-toolchain=stable --profile=minimal -y
@@ -77,3 +77,7 @@ jobs:
7777
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
7878
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
7979
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
80+
- name: Clear the cargo caches
81+
run: |
82+
cargo install cargo-cache --no-default-features --features ci-autoclean
83+
cargo-cache

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,17 @@ jobs:
7575
uses: actions/cache@v1
7676
with:
7777
path: ~/.cargo/registry
78-
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
79-
- name: Cache cargo index
78+
key: ${{ runner.os }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
79+
- name: Cache cargo git trees
8080
uses: actions/cache@v1
8181
with:
8282
path: ~/.cargo/git
83-
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
83+
key: ${{ runner.os }}-cargo-gits-trimmed-${{ hashFiles('**/Cargo.lock') }}
8484
- name: Cache cargo build
8585
uses: actions/cache@v1
8686
with:
8787
path: target
88-
key: ${{ runner.os }}-cargo-build-static-crt-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
88+
key: ${{ runner.os }}-cargo-build-static-crt-trimmed-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
8989
- name: Install Rustup using win.rustup.rs
9090
run: |
9191
# Disable the download progress bar which can cause perf issues
@@ -180,3 +180,7 @@ jobs:
180180
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
181181
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
182182
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
183+
- name: Clear the cargo caches
184+
run: |
185+
cargo install cargo-cache --no-default-features --features ci-autoclean
186+
cargo-cache

0 commit comments

Comments
 (0)