Skip to content

Apache DataFusion SQL Query Engine

Improve cache usage in CI (#7678)

Kousuke Sarutade1591770445
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index fa5c56b43e..80de6e663f 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -47,18 +47,24 @@ jobs:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- - name: Cache Cargo
- uses: actions/cache@v3
- with:
- # these represent dependencies downloaded by cargo
- # and thus do not depend on the OS, arch nor rust version.
- path: /github/home/.cargo
- key: cargo-cache-
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: stable
+ - name: Cache Cargo
+ uses: actions/cache@v3
+ with:
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ ./target/
+ ./datafusion-cli/target/
+ # this key equals the ones on `linux-build-lib` for re-use
+ key: cargo-cache-benchmark-${{ hashFiles('datafusion/**/Cargo.toml', 'benchmarks/Cargo.toml', 'datafusion-cli/Cargo.toml') }}
+
- name: Check workspace without default features
run: cargo check --no-default-features -p datafusion
@@ -84,12 +90,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- - name: Cache Cargo
- uses: actions/cache@v3
- with:
- path: /github/home/.cargo
- # this key equals the ones on `linux-build-lib` for re-use
- key: cargo-cache-
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
@@ -109,12 +109,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- - name: Cache Cargo
- uses: actions/cache@v3
- with:
- path: /github/home/.cargo
- # this key equals the ones on `linux-build-lib` for re-use
- key: cargo-cache-
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
@@ -211,12 +205,6 @@ jobs:
image: amd64/rust
steps:
- uses: actions/checkout@v4
- - name: Cache Cargo
- uses: actions/cache@v3
- with:
- path: /github/home/.cargo
- # this key equals the ones on `linux-build-lib` for re-use
- key: cargo-cache-
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
@@ -241,9 +229,14 @@ jobs:
- name: Cache Cargo
uses: actions/cache@v3
with:
- path: /github/home/.cargo
+ path: |
+ ~/.cargo/bin/
+ ~/.cargo/registry/index/
+ ~/.cargo/registry/cache/
+ ~/.cargo/git/db/
+ ./target/
# this key equals the ones on `linux-build-lib` for re-use
- key: cargo-cache-
+ key: cargo-cache-benchmark-${{ hashFiles('datafusion/**/Cargo.toml', 'benchmarks/Cargo.toml') }}
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
@@ -377,12 +370,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- - name: Cache Cargo
- uses: actions/cache@v3
- with:
- path: /github/home/.cargo
- # this key equals the ones on `linux-build-lib` for re-use
- key: cargo-cache-
- uses: actions/setup-python@v4
with:
python-version: "3.8"
@@ -480,12 +467,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- - name: Cache Cargo
- uses: actions/cache@v3
- with:
- path: /github/home/.cargo
- # this key equals the ones on `linux-build-lib` for re-use
- key: cargo-cache-
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
@@ -506,12 +487,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- - name: Cache Cargo
- uses: actions/cache@v3
- with:
- path: /github/home/.cargo
- # this key equals the ones on `linux-build-lib` for re-use
- key: cargo-cache-
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
@@ -531,12 +506,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- - name: Cache Cargo
- uses: actions/cache@v3
- with:
- path: /github/home/.cargo
- # this key equals the ones on `linux-build-lib` for re-use
- key: cargo-cache-
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
@@ -563,12 +532,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
- - name: Cache Cargo
- uses: actions/cache@v3
- with:
- path: /github/home/.cargo
- # this key equals the ones on `linux-build-lib` for re-use
- key: cargo-cache-
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with: