Skip to content

Commit a81e83a

Browse files
committed
CI: use Cabal Store env variable that alredy provided by default
In & below: https://github.com/haskell/actions/blob/45e670e88ef506f3c7c305ffa3abbf1c08a38d63/setup/lib/setup-haskell.js#L61 is seen that it is exact Windows & Linux & macOS settings. No need to guess with matching the CABAL_STORE variable to reality, while haskell action already gives the value of that variable.
1 parent f2df43e commit a81e83a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/cache-deps.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ jobs:
5757
- uses: actions/checkout@v2
5858
with:
5959
submodules: true
60+
6061
- uses: haskell/actions/setup@v1
62+
id: HaskEnvSetup
6163
with:
6264
ghc-version: ${{ matrix.ghc }}
6365
cabal-version: "3.4"
6466

6567
- if: matrix.os == 'windows-latest'
6668
name: Set some window specific things
6769
run: |
68-
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
6970
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
7071
7172
- if: (${{ env.RUNNER_OS }} == 'Linux') || (${{ env.RUNNER_OS}} == 'macOS')
7273
name: Set some Linux/macOS specific things
7374
run: |
74-
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
7575
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
7676
7777
- if: matrix.os == 'macOS-latest' && matrix.ghc == '8.10.5'
@@ -97,8 +97,8 @@ jobs:
9797
cache-name: cache-cabal
9898
with:
9999
path: |
100+
${{ steps.HaskEnvSetup.outputs.cabal-store }}
100101
${{ env.CABAL_PKGS_DIR }}
101-
${{ env.CABAL_STORE_DIR }}
102102
key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }}
103103
restore-keys: v2-${{ runner.os }}-${{ matrix.ghc }}-build-
104104

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
with:
7979
submodules: true
8080
- uses: haskell/actions/setup@v1
81+
id: HaskEnvSetup
8182
with:
8283
ghc-version: ${{ matrix.ghc }}
8384
cabal-version: "3.4"
@@ -88,14 +89,12 @@ jobs:
8889
- if: ${{ env.RUNNER_OS }} == 'Windows'
8990
name: Set some window specific things
9091
run: |
91-
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
9292
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
9393
9494
9595
- if: (${{ env.RUNNER_OS }} == 'Linux') || (${{ env.RUNNER_OS}} == 'macOS')
9696
name: Set some Linux/macOS specific things
9797
run: |
98-
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
9998
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
10099
101100
- if: matrix.os == 'macOS-latest' && matrix.ghc == '8.10.5'
@@ -121,8 +120,8 @@ jobs:
121120
cache-name: cache-cabal
122121
with:
123122
path: |
123+
${{ steps.HaskEnvSetup.outputs.cabal-store }}
124124
${{ env.CABAL_PKGS_DIR }}
125-
${{ env.CABAL_STORE_DIR }}
126125
restore-keys: v2-${{ runner.os }}-${{ matrix.ghc }}-build-
127126

128127
- run: cabal update

0 commit comments

Comments
 (0)