Skip to content

Commit f510b8a

Browse files
committed
Set dirs for windows cabal cache
1 parent 2efabfe commit f510b8a

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Testing
22

3+
defaults:
4+
run:
5+
shell: bash
6+
37
on: [pull_request]
48
jobs:
59
test:
@@ -63,14 +67,26 @@ jobs:
6367
- run: ./fmt.sh
6468
name: "HLint via ./fmt.sh"
6569

70+
- name: Set some window specific things
71+
if: matrix.os == 'windows-latest'
72+
run: |
73+
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
74+
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
75+
76+
- name: Set some linux/macOS specific things
77+
if: matrix.os != 'windows-latest'
78+
run: |
79+
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
80+
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
81+
6682
- name: Cache Cabal
6783
uses: actions/cache@v2
6884
env:
6985
cache-name: cache-cabal
7086
with:
7187
path: |
72-
~/.cabal/packages
73-
~/.cabal/store
88+
${{ env.CABAL_PKGS_DIR }}
89+
${{ env.CABAL_STORE_DIR }}
7490
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }}
7591
restore-keys: |
7692
${{ runner.os }}-${{ matrix.ghc }}-bench-$${ hashFiles('cabal.project') }}
@@ -81,7 +97,6 @@ jobs:
8197

8298
# Need this to work around filepath length limits in Windows
8399
- name: Shorten binary names
84-
shell: bash
85100
run: |
86101
sed -i.bak -e 's/haskell-language-server/hls/g' \
87102
-e 's/haskell_language_server/hls/g' \
@@ -90,30 +105,26 @@ jobs:
90105
src/**/*.hs exe/*.hs
91106
92107
- name: Build
93-
shell: bash
94108
# Retry it three times to workaround compiler segfaults in windows
95109
run: cabal build || cabal build || cabal build
96110

97111
- name: Test ghcide
98112
if: ${{ !matrix.ghc-lib && matrix.test }}
99-
shell: bash
100113
# run the tests without parallelism to avoid running out of memory
101114
run: cabal test ghcide --test-options="-j1 --rerun-update" || cabal test ghcide --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test ghcide --test-options="-j1 --rerun"
102115

103116
- name: Test func-test suite
104117
if: ${{ !matrix.ghc-lib && matrix.test }}
105-
shell: bash
106118
env:
107119
HLS_TEST_EXE: hls
108120
HLS_WRAPPER_TEST_EXE: hls-wrapper
109121
# run the tests without parallelism, otherwise tasty will attempt to run
110122
# all functional test cases simultaneously which causes way too many hls
111123
# instances to be spun up for the poor github actions runner to handle
112-
run: cabal test func-test --test-options="-j1 --rerun-update" || cabal test func-test --test-options="-j1 --rerun --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"
124+
run: cabal test func-test --test-options="-j1 --rerun --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"
113125

114126
- name: Test wrapper-test suite
115127
if: ${{ !matrix.ghc-lib && matrix.test }}
116-
shell: bash
117128
env:
118129
HLS_TEST_EXE: hls
119130
HLS_WRAPPER_TEST_EXE: hls-wrapper

0 commit comments

Comments
 (0)