Skip to content

Commit 726c1ae

Browse files
authored
Add stack cache
1 parent d67ac03 commit 726c1ae

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/haskell.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
ghc-version: ${{ matrix.ghc }}
2020
cabal-version: '3.6'
2121

22-
- name: Cache
22+
- name: Cabal cache
2323
uses: actions/cache@v1
2424
env:
2525
cache-name: cache-cabal
@@ -28,8 +28,16 @@ jobs:
2828
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
2929
restore-keys: |
3030
${{ runner.os }}-build-${{ env.cache-name }}-
31-
${{ runner.os }}-build-
32-
${{ runner.os }}-
31+
32+
- name: Stack cache
33+
uses: actions/cache@v1
34+
env:
35+
cache-name: cache-stack
36+
with:
37+
path: ~/.stack
38+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/stack.yaml') }}
39+
restore-keys: |
40+
${{ runner.os }}-build-${{ env.cache-name }}-
3341
3442
- name: Cabal update
3543
run: cabal update
@@ -38,6 +46,6 @@ jobs:
3846
- name: Test
3947
run: cabal test all
4048
# stack build uses stack.yaml which actually uses ghc-8.10.7
41-
- if: matrix.ghc == '8.10.7'
49+
- if: matrix.ghc == '8.10.7' && runner.os == 'Linux'
4250
name: Build using stack
4351
run: stack build

0 commit comments

Comments
 (0)