jonathanknowles / jonathanknowles/haskell-example
cabal freeze file is not so suitable as cache key
- Dominant language
- Haskell
- Stars
- 7
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Thanks for publishing this action! Here a comment on cache keys:
https://github.com/jonathanknowles/haskell-example/blob/ed8660f6ef691559bd0e473eabfbe96e6cd9608e/.github/workflows/build.yml#L63-L75
Since `cabal.project.freeze` will contain the Hackage repository timestamp, it will be different in almost every single CI run. Thus, it might not be a suitable cache key, being similar to `${{ github.sha }}`.
I settled for `dist-newstyle/cache/plan.json` instead which only contains the package versions, no time stamps. It is generated by `cabal build --dry-run`.
See e.g. https://github.com/agda/agda/blob/e018e58453a06e4c4a15c9b81396cbcd1e2c640f/src/github/workflows/cabal.yml#L148-L171
There might be reasons why you want the primary key being different in each run, but then it is easier to just use `${{ github.sha }}`.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.