Skip to content
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

Add cachePath as an output for easier access #1436

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

llakala
Copy link
Contributor

@llakala llakala commented Jul 19, 2024

Description

I've updated the constants to expect cachePath to exist, and saved cachePath as the value set in the path input, unchanged. This is so it can be properly reused in the future. I've also updated all the tests to accommodate the changes, and updated the documentation.

Motivation and Context

Github Actions will only save caches if all tests pass. This is unhelpful is the result of a test doesn't equate to an invalid cache. The recommended aapproach to solve this is to use actions/cache/restore and actions/cache/save to separate the actions of saving and loading. However, this adds a point of common issues when it comes to ensuring the keys and paths are the same for both saving and loading. You'd likely do these at different times, so they'll be very split up. This makes it easy for the two to get desynced by accident. To help resolve this, cache-primary-key and cache-matched-key exist as outputs. This is very helpful, since you can just reuse those outputs for saving the cache. However, the same doesn't exist for the path. This implements that, so you can reuse the path and making your saving workflow simpler.

How Has This Been Tested?

I've updated all of the testing files to expect the changes, and they now all properly pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (add or update README or docs)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@llakala llakala requested a review from a team as a code owner July 19, 2024 21:26
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.

1 participant