Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: persist Rust caches for Pip package build (#4480)
Summary: The `build-data-server-pip` job runs on two platforms on every push, and each run takes about 5 minutes. The vast majority of this time (85%) is spent building all dependencies from scratch. Since [macOS minutes are priced at 10× the rate of Linux minutes][pricing] and this is our only macOS job, we may as well spend a modicum of effort to improve this. [pricing]: https://docs.github.com/en/free-pro-team@latest/github/setting-up-and-managing-billing-and-payments-on-github/about-billing-for-github-actions#about-billing-for-github-actions The docs at <https://github.com/actions/cache> say that a repository can have up to 5 GB of caches. The cache for our other Rust job is ~200 MB, and we don’t have any other caches, so adding two more of those caches seems okay. The caches are also invalidated infrequently: only when we update Rust dependencies or update the workflow file itself. Adding a cache should speed up these builds. We already do this for the Rust lint job, and it works well. This is a separate cache because the job builds in release mode rather than debug mode. Rust builds generally have good hermeticity properties, so this should be fairly safe. If we want to be extra safe, we could turn this off for builds that will be published in an actual stable release. Test Plan: Note that the second run of the checks for this PR spends less time in the “Build” and “Test” phases. It appears to still spend about a minute total building, even though it hits cache. I’m not sure why—this is not the case for normal, local, incremental builds—but this is still an improvement of about 65%, so I’m okay with it for now. wchargin-branch: ci-cache-rust-pip
- Loading branch information