@@ -68,22 +68,18 @@ jobs:
68
68
steps :
69
69
- uses : actions/checkout@v2
70
70
71
+ - name : Ensure CABAL_DIR environment variable is set
72
+ run : |
73
+ CABAL_DIR="${CABAL_DIR:-~/.cabal}"
74
+ echo "CABAL_DIR=$CABAL_DIR" >> $GITHUB_ENV
75
+
71
76
- uses : haskell/actions/setup@v1
72
77
id : HaskEnvSetup
73
78
with :
74
79
ghc-version : ${{ matrix.ghc }}
75
80
cabal-version : ${{ matrix.cabal }}
76
81
enable-stack : false
77
82
78
- - if : runner.os == 'Windows'
79
- name : (Windows) Platform config
80
- run : |
81
- echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
82
- - if : ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
83
- name : (Linux,macOS) Platform config
84
- run : |
85
- echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
86
-
87
83
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
88
84
- if : matrix.ghc == '9.0.1'
89
85
name : (GHC 9.0.1) Use modified `cabal.project`
@@ -125,7 +121,7 @@ jobs:
125
121
env :
126
122
cache-name : hackage-sources
127
123
with :
128
- path : ${{ env.CABAL_PKGS_DIR }}
124
+ path : ${{ env.CABAL_DIR }}/packages
129
125
key : ${{ env.cache-name }}-${{ env.INDEX_STATE }}
130
126
restore-keys : ${{ env.cache-name }}-
131
127
@@ -134,7 +130,7 @@ jobs:
134
130
env :
135
131
cache-name : compiled-deps
136
132
with :
137
- path : ${{ steps.HaskEnvSetup.outputs.cabal-store }}
133
+ path : ${{ env.CABAL_DIR }}/store
138
134
key : ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project') }}
139
135
restore-keys : |
140
136
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.INDEX_STATE }}-
0 commit comments