Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `inputs.cache-save-always` 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 * Documentation * Evaluate input as string * Use `-partial` key to no-op after full cache-hit 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. * Set suffix using conditionally run step 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. * Revert "Set suffix using conditionally run step" This reverts commit dd40c85. * Revert "Use `-partial` key to no-op after full cache-hit" This reverts commit 629a6a9. * Extend conditional in build/save-cache steps 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. * Update input documentation
- Loading branch information