https://github.com/freckle/stack-cache-action
One-line caching action for Stack-based Haskell projects
https://github.com/freckle/stack-cache-action
ghvm-managed
Last synced: about 1 year ago
JSON representation
One-line caching action for Stack-based Haskell projects
- Host: GitHub
- URL: https://github.com/freckle/stack-cache-action
- Owner: freckle
- License: mit
- Created: 2021-04-24T18:52:57.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-05-03T10:43:06.000Z (about 1 year ago)
- Last Synced: 2025-05-12T22:03:33.649Z (about 1 year ago)
- Topics: ghvm-managed
- Language: JavaScript
- Homepage:
- Size: 1.52 MB
- Stars: 13
- Watchers: 13
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Stack Cache Action
Cache step for Stack-based Haskell projects on GitHub Actions.
**NOTE**: if you are using `freckle/stack-action@v4` or newer, you do not
need this action as its own step. That version of that action handles all
caching internally, and better.
## Usage
```yml
uses: freckle/stack-cache-action@v2
```
## Behavior
1. Restores/saves `~/.stack` and _all_ `.stack-work` directories, as determined
by the location of `.cabal` and `package.yaml` files
1. 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.
1. Falls back to same resolver/dependencies, then same resolver (but no further)
## Inputs
- `stack-yaml`: Path to your `stack.yaml` file
- `working-directory`: Useful in monorepositories
- `prefix`: A prefix to include on keys; useful for cache busting or versioning
## Outputs
- `cache-hit`: indicates a full cache hit on the primary key
## Further Reading
See https://tech.freckle.com/2021/05/18/haskell-on-actions/ for a short tutorial.
## Acknowledgements
The idea and initial repository skeleton was taken from [gha-yarn-cache][].
[gha-yarn-cache]: https://github.com/c-hive/gha-yarn-cache
---
[LICENSE](./LICENSE) | [CHANGELOG](./CHANGELOG.md)