Skip to content

Commit

Permalink
Key Stack cache on deps hash
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisCardwell committed Jul 8, 2024
1 parent 32207c2 commit 36c87d1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.CACHE_CABAL_KEY_PREFIX }}-ttc-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.CACHE_CABAL_KEY_PREFIX }}-ttc-
restore-keys: ${{ env.CACHE_CABAL_KEY_PREFIX }}-ttc-plan-

- name: "ttc: cabal: install dependencies"
run: cabal build all $CABAL_OPTS --only-dependencies
Expand All @@ -113,13 +113,16 @@ jobs:
- name: "ttc: cabal: examples"
run: cabal build ttc-examples -f examples $CABAL_OPTS

- name: "ttc: stack: configure build"
run: stack ls dependencies json > stack-deps.json

- name: "ttc: stack: restore cache"
uses: actions/cache/restore@v3
id: cache-stack-ttc
with:
path: .stack-work
key: ${{ env.CACHE_STACK_KEY_PREFIX }}-ttc-${{ hashFiles('ttc.cabal', env.STACK_YAML) }}
restore-keys: ${{ env.CACHE_STACK_KEY_PREFIX }}-ttc-
key: ${{ env.CACHE_STACK_KEY_PREFIX }}-ttc-deps-${{ hashFiles('stack-deps.json') }}
restore-keys: ${{ env.CACHE_STACK_KEY_PREFIX }}-ttc-deps-

- name: "ttc: stack: build"
run: stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
Expand Down

0 comments on commit 36c87d1

Please sign in to comment.