-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Thanks for publishing this action! Here a comment on cache keys:
haskell-example/.github/workflows/build.yml
Lines 63 to 75 in ed8660f
| - name: Freeze | |
| run: > | |
| cabal freeze | |
| --builddir=${{ env.cabal-build-dir }} | |
| - name: Cache | |
| uses: actions/cache@v3 | |
| env: | |
| hash: ${{ hashFiles('cabal.project.freeze') }} | |
| with: | |
| key: ${{ matrix.os }}-ghc-${{ matrix.ghc }}-${{ env.hash }} | |
| restore-keys: | | |
| ${{ matrix.os }}-ghc-${{ matrix.ghc }}- |
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.
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 }}.
jonathanknowlesjonathanknowles
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request