-
Notifications
You must be signed in to change notification settings - Fork 5
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 inputs.cache-save-always
#34
Conversation
Adds an input that borrows the `save-always` input from [v4 of `actions/cache`][0], which will run the post step to save the cache even if a failure occurs. Using the added `cache-save-always` input saves the cache when a build fails, which will speed up subsequent runs which restore the partial build. This comes at the cost of requiring a build when there is an exact `key` match, since the cache from a failed build will have the same `key` as a completed build. [0]: https://github.com/actions/cache/tree/main#v4
This will require a major version since this changes the noop-behavior on a full cache hit. If the trade-offs seem worthwhile (and I'm not missing anything about how Stack might treat these artifacts) then I'll bump the version and update the docs. |
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.
Love that this is opt-in. I think that makes it fine that there's a trade-off ("build even on full hit"). I don't follow why this would be a major version bump. It seems to be adding a new option with the same behavior by default... e.g. minor.
Sounds good; I wasn't sure how to characterize the risk of removing the noop. The behavior is certainly the same and what is changed in the default scenario, not making use of the input, is an implementation detail. |
Saves the set of build artifacts after a build failure with a `-partial` suffix on the cache key. A full cache-hit will therefore only occur when restoring the cache saved after a successful build, allowing for the subsequent `stack build` and cache-save steps to be skipped.
b171ee0
to
629a6a9
Compare
Status check functions can only be used in `if` conditionals, so the use of a cache key suffix needs to be determined in a conditionally-run step.
This reverts commit dd40c85.
This reverts commit 629a6a9.
Checks that the workflow has not been cancelled (i.e., is succeeding or failed) and that `cache-save-always: true` when building and saving the cache. This extends the existing conditional on the `cache-hit` outputs, making the previously-implied `success()` check explicit. When `cache-save-always: false`, the default behavior is unchanged for the action: steps either no-op if a cache-hit occurred, or build and save otherwise. When `cache-save-always: true`, a building and saving the cache occurs on success or failure.
Adds an input that borrows the
save-always
input from v4 ofactions/cache
, which will run the post step to save the cache even if a failure occurs. Using the addedcache-save-always
input saves the cache when a build fails, which will speed up subsequent runs which restore the partial build. This comes at the cost of requiring a build when there is an exactkey
match, since the cache from a failed build will have the samekey
as a completed build.