-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Use a standard Cargo caching action #17169
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,28 +243,6 @@ def install_rustup() -> Step: | |
} | ||
|
||
|
||
def rust_caches() -> Sequence[Step]: | ||
return [ | ||
{ | ||
"name": "Cache Rust toolchain", | ||
"uses": "actions/cache@v3", | ||
"with": { | ||
"path": f"~/.rustup/toolchains/{rust_channel()}-*\n~/.rustup/update-hashes\n~/.rustup/settings.toml\n", | ||
"key": f"{gha_expr('runner.os')}-rustup-{hashFiles('rust-toolchain')}-v1", | ||
}, | ||
}, | ||
{ | ||
"name": "Cache Cargo", | ||
"uses": "actions/cache@v3", | ||
"with": { | ||
"path": "~/.cargo/registry\n~/.cargo/git\n", | ||
"key": f"{gha_expr('runner.os')}-cargo-{hashFiles('rust-toolchain')}-{hashFiles('src/rust/engine/Cargo.*')}-v1\n", | ||
"restore-keys": f"{gha_expr('runner.os')}-cargo-{hashFiles('rust-toolchain')}-\n", | ||
}, | ||
}, | ||
] | ||
|
||
|
||
def install_jdk() -> Step: | ||
return { | ||
"name": "Install AdoptJDK", | ||
|
@@ -403,16 +381,22 @@ def rust_caches(self) -> Sequence[Step]: | |
"uses": "actions/cache@v3", | ||
"with": { | ||
"path": f"~/.rustup/toolchains/{rust_channel()}-*\n~/.rustup/update-hashes\n~/.rustup/settings.toml\n", | ||
"key": f"{self.platform_name()}-rustup-{hashFiles('rust-toolchain')}-v1", | ||
"key": f"{self.platform_name()}-rustup-{hashFiles('rust-toolchain')}-v2", | ||
}, | ||
}, | ||
{ | ||
"name": "Cache Cargo", | ||
"uses": "actions/cache@v3", | ||
"uses": "benjyw/rust-cache@461b9f8eee66b575bce78977bf649b8b7a8d53f1", | ||
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. Should probably fork this to the 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. My hope is to upstream it, but that is the fallback. |
||
"with": { | ||
"path": "~/.cargo/registry\n~/.cargo/git\n", | ||
"key": f"{self.platform_name()}-cargo-{hashFiles('rust-toolchain')}-{hashFiles('src/rust/engine/Cargo.*')}-v1\n", | ||
"restore-keys": f"{self.platform_name()}-cargo-{hashFiles('rust-toolchain')}-\n", | ||
# If set, replaces the job id in the cache key, so that the cache is stable across jobs. | ||
# If we don't set this, each job may restore from a previous job's cache entry (via a | ||
# restore key) but will write its own entry, even if there were no rust changes. | ||
# This will cause us to hit the 10GB limit much sooner, and also spend time uploading | ||
# identical cache entries unnecessarily. | ||
"shared-key": "engine", | ||
"workspaces": "src/rust/engine", | ||
# A custom option from our fork of the action. | ||
"cache-bin": "false", | ||
}, | ||
}, | ||
] | ||
|
@@ -591,6 +575,8 @@ def test_python_linux(shard: str) -> dict[str, Any]: | |
**helper.build_wheels_common, | ||
"steps": [ | ||
*checkout(containerized=True), | ||
# TODO: Why is this necessary? the hosted container is | ||
# supposed to come with rustup preinstalled. | ||
install_rustup(), | ||
{ | ||
"name": "Expose Pythons", | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 was unused, a relic from before we moved it under Helper.