ci: Add cache for pre-commit environments#182
Merged
Conversation
Cache works, no need for the test.txt file anymore.
fmalatino
approved these changes
Jul 24, 2025
jjuyeonkim
pushed a commit
to jjuyeonkim/NDSL
that referenced
this pull request
Sep 8, 2025
* Add cache for pre-commit environments * Don't pull submodules (we don't lint external code
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
Caching the
pre-commitenvironments. I realized this wasn't done. It's not breaking the bank, but it saves like 10 seconds on the linting workflow. Once merged todevelop, all branches merging into develop can re-use the cache that is ondevelop, which never changes unless we update one of the environments (which we rarely do).We can save another 10 seconds by not pulling submodules. NDSL has submodules of
gt4pyanddace. Both are external code that we aren't linting. We thus don't need to pull those in the linting workflow.How Has This Been Tested?
By running the linting workflow of this branch multiple times and observing the workflow's output. The cache is properly restored and pre-commit environments don't need to be re-initialized in the second run.
Checklist: