Skip to content

ci: Add cache for pre-commit environments#182

Merged
romanc merged 4 commits into
NOAA-GFDL:developfrom
romanc:romanc/pre-commit-cache
Jul 24, 2025
Merged

ci: Add cache for pre-commit environments#182
romanc merged 4 commits into
NOAA-GFDL:developfrom
romanc:romanc/pre-commit-cache

Conversation

@romanc
Copy link
Copy Markdown
Collaborator

@romanc romanc commented Jul 18, 2025

Description

Caching the pre-commit environments. I realized this wasn't done. It's not breaking the bank, but it saves like 10 seconds on the linting workflow. Once merged to develop, all branches merging into develop can re-use the cache that is on develop, 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 gt4py and dace. 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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas: N/A
  • I have made corresponding changes to the documentation: N/A
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules: N/A
  • New check tests, if applicable, are included: N/A

@romanc romanc marked this pull request as ready for review July 18, 2025 09:32
@romanc romanc requested a review from fmalatino July 18, 2025 09:32
@romanc romanc merged commit 3504d1c into NOAA-GFDL:develop Jul 24, 2025
5 checks passed
@romanc romanc deleted the romanc/pre-commit-cache branch July 24, 2025 14:40
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants