Cache step for Stack-based Haskell projects on GitHub Actions.
uses: bitnomial/stack-cache-action@main
-
Restores/saves
~/.stack
and all.stack-work
directories, as determined by the location of.cabal
andpackage.yaml
files -
Includes a hash of all source files in the cache key, so a new cache will be saved even if the dependencies haven't changed. This prevents re-compilation of un-changed modules in later builds.
-
Falls back to same resolver/dependencies, then same resolver (but no further)
stack-yaml
: Path to yourstack.yaml
fileworking-directory
: Useful in monorepositoriesprefix
: A prefix to include on keys; useful for cache busting or versioning
cache-hit
: indicates a full cache hit on the primary key
The idea and initial repository skeleton was taken from gha-yarn-cache.