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 inputs.cache-save-always #34

Merged
merged 9 commits into from
Jan 23, 2024
Merged

Add inputs.cache-save-always #34

merged 9 commits into from
Jan 23, 2024

Commits on Jan 18, 2024

  1. 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
    stackptr committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    60924a3 View commit details
    Browse the repository at this point in the history
  2. Documentation

    stackptr committed Jan 18, 2024
    Configuration menu
    Copy the full SHA
    896bf2a View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2024

  1. Evaluate input as string

    stackptr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    ffa7c66 View commit details
    Browse the repository at this point in the history
  2. 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.
    stackptr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    629a6a9 View commit details
    Browse the repository at this point in the history
  3. 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.
    stackptr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    dd40c85 View commit details
    Browse the repository at this point in the history
  4. Revert "Set suffix using conditionally run step"

    This reverts commit dd40c85.
    stackptr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    c6b9b20 View commit details
    Browse the repository at this point in the history
  5. Revert "Use -partial key to no-op after full cache-hit"

    This reverts commit 629a6a9.
    stackptr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    58fa478 View commit details
    Browse the repository at this point in the history
  6. 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.
    stackptr committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    59b90b6 View commit details
    Browse the repository at this point in the history

Commits on Jan 23, 2024

  1. Update input documentation

    stackptr committed Jan 23, 2024
    Configuration menu
    Copy the full SHA
    d36a2d5 View commit details
    Browse the repository at this point in the history