Skip to content

Commit

Permalink
Merge #3737
Browse files Browse the repository at this point in the history
3737: Optimise caching r=amesgen a=newhoggy



Co-authored-by: John Ky <john.ky@iohk.io>
  • Loading branch information
iohk-bors[bot] and newhoggy committed May 17, 2022
2 parents 163408c + a374f3b commit b414a0d
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,27 @@ jobs:
- uses: actions/checkout@v2

- name: Cache cabal store
uses: actions/cache@v2
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: cabal-store-${{ env.CACHE_VERSION }}-${{ matrix.ghc }}-${{ matrix.os }}

- name: Update Hackage index
run: cabal update

- name: Cabal Configure
run: cabal --builddir="$CABAL_BUILDDIR" configure --enable-tests

- name: Record dependencies
run: |
cabal build all --dry-run
cat dist-newstyle/cache/plan.json | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt
date > date.txt
- uses: actions/cache@v2
name: Cache cabal store
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
restore-keys: |
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
cache-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
- name: Use cabal.project.local.ci
run: |
cat ./cabal.project.local.ci >> ./cabal.project.local
Expand Down

0 comments on commit b414a0d

Please sign in to comment.