File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 13
13
os : [ubuntu-latest, macos-latest, windows-latest]
14
14
15
15
steps :
16
+ - name : Set cache version
17
+ run : echo "CACHE_VERSION=pu4Aevoo" >> $GITHUB_ENV
18
+
16
19
- name : " Setup haskell"
17
20
uses : haskell/actions/setup@v1
18
21
id : setup-haskell
27
30
cat ./.github/workflows/cabal.project.local > ./cabal.project.local
28
31
cat ./cabal.project.local
29
32
33
+ - name : Record dependencies
34
+ id : record-deps
35
+ run : |
36
+ cabal build all --dry-run
37
+ cat dist-newstyle/cache/plan.json | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt
38
+ echo "::set-output name=weeknum::$(/bin/date -u "+%W")"
39
+
40
+ - uses : actions/cache@v3
41
+ name : " Cache `cabal store`"
42
+ with :
43
+ path : ${{ runner.os == 'Windows' && steps.win-setup-haskell.outputs.cabal-store || steps.setup-haskell.outputs.cabal-store }}
44
+ key : cache-dependencies-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }}
45
+ restore-keys : cache-dependencies-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
46
+
47
+ - uses : actions/cache@v3
48
+ name : " Cache `dist-newstyle`"
49
+ with :
50
+ path : |
51
+ dist-newstyle
52
+ !dist-newstyle/**/.git
53
+ key : cache-dist-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ steps.record-deps.outputs.weeknum }}
54
+ restore-keys : cache-dist-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}
55
+
30
56
- name : Build dependencies
31
57
run : cabal build --only-dependencies all
32
58
You can’t perform that action at this time.
0 commit comments