-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Improve cache usage in CI #7678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The key above also includes
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it's intended. |
||
- 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: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cache key doesn't change unless we update the dependencies, right? What about the local code changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply.
Yes.
Local code change (except for Cargo.toml specified in
hashFiles
) doesn't affect the cache.