Skip to content

Conversation

@romanc
Copy link
Collaborator

@romanc romanc commented Sep 8, 2025

Description

This PR add support for caching the pre-commit environment in GHA linting workflows. GitHub imposes the following rules on cache sharing. Caches can be restored by a workflow if

  1. they were created by a previous run of the workflow
  2. they were created by the target branch of this PR

We thus add an explicit cache creation workflow that runs when ever we merge into develop. This PR will create caches that can be reused (as intended by 2) above) by any PR targeting the develop branch.

How Has This Been Tested?

This is a propagation of PR NOAA-GFDL/NDSL#202 in NDSL, which works as advertised. I'll double check after the first run that this also works as intended in this repository. If not, I'll do follow-up PRs in a timely manner.

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
  • 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
Copy link
Collaborator Author

romanc commented Sep 8, 2025

@fmalatino this is a similar PR as in other repos. Can't tag you as a reviewer, so here's a manual ping 😉

@fmalatino fmalatino self-requested a review September 8, 2025 10:51
@fmalatino fmalatino added this pull request to the merge queue Sep 8, 2025
Merged via the queue into NOAA-GFDL:develop with commit fc8700b Sep 8, 2025
2 checks passed
@romanc romanc deleted the romanc/ci-effective-cache-sharing branch September 8, 2025 12:07
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