-
-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor producing cache keys in GHA jobs #1389
Conversation
8aad088
to
97aaf40
Compare
|
||
- name: Calculate cache metadata | ||
id: cache-meta | ||
shell: python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder can we put this script into a python file and run it instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a good idea. Moving the context out of the workflow makes it harder to follow and forces people to look up external sources. This would be different if it was needed outside of GHA, of course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, hashFiles()
is only accessible within workflows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be possible to make it a composite action but it looks like an overkill.
@webknjaz Please make it draft until is ready for review and merge. |
pip can now be cached via https://github.com/actions/setup-python#caching-packages-dependencies Please see #1571 for an alternative. |
This change makes the GHA cache dirs and keys calculated dynamically per recommendation @ #1378 (comment).
Changelog-friendly one-liner: $sbj (not user-facing)
Contributor checklist