ci: Effective cache sharing between PRs#202
Merged
romanc merged 1 commit intoNOAA-GFDL:developfrom Sep 5, 2025
Merged
Conversation
Collaborator
Author
|
@fmalatino any comments on this PR as a proof of concept? Do you think it's legit or totally over-engineered? |
Contributor
|
It looks good! And I agree, once we move to pinned versions we should investigate doing this for the unit tests as well. |
Collaborator
Author
|
Revisiting this old proof of concept since we have a little room again. As mentioned, there's not a whole lot to cache at the moment (since we don't lock python dependencies), but I'd like to gather some experience with this technique to see how it holds up in usage compared to on paper. |
Collaborator
Author
|
Any more thoughts on this? I'm fine either way, just want to get to a resolution soon. |
This was referenced Sep 8, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
As mentioned in #186 (comment), our caching is currently sub-optimal and only really works for subsequent runs on the same PR.
Ideally, we'd like to share caches between PRs such that not every PR has to first build a cache. The way GHA caches work is that they can only be accessed if they were created by the same PR or by the target branch. I've thus added a workflow to (re-)create the pre-commit cache whenever we merge into the
developbranch. The linting workflow (running on PRs) will just restore the cache (and not attempt to upload a new one).Caching the test_data needs to be done in the workflow that creates the cache (e.g., for the "PyFV3 translate tests" we need to modify the workflow(s) in the PyFV3 repo).
We could cache the pip cache for "NDSL unit tests". However, since we (mostly) aren't pinning python package dependencies to specific version numbers (in
setup.pyandpyproject.toml), this cache would get out of date soon. And since the runtime of NDSL unit tests are governed by the test runtime, I don't see a need for that right now. Once we pin package dependencies with a lock file, we can re-evaluate.The changes in the pull request template are unrelated. They just stop my editor from complaining about invalid markdown syntax in that file. The changes are due to the following rules
# Header**bold font**as headersHow Has This Been Tested?
Tested the new workflow on my fork of NDSL.
Checklist