1
1
name : Testing
2
2
3
+ defaults :
4
+ run :
5
+ shell : bash
6
+
3
7
on : [pull_request]
4
8
jobs :
5
9
test :
@@ -63,14 +67,26 @@ jobs:
63
67
- run : ./fmt.sh
64
68
name : " HLint via ./fmt.sh"
65
69
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
+
66
82
- name : Cache Cabal
67
83
uses : actions/cache@v2
68
84
env :
69
85
cache-name : cache-cabal
70
86
with :
71
87
path : |
72
- ~/.cabal/packages
73
- ~/.cabal/store
88
+ ${{ env.CABAL_PKGS_DIR }}
89
+ ${{ env.CABAL_STORE_DIR }}
74
90
key : ${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }}
75
91
restore-keys : |
76
92
${{ runner.os }}-${{ matrix.ghc }}-bench-$${ hashFiles('cabal.project') }}
81
97
82
98
# Need this to work around filepath length limits in Windows
83
99
- name : Shorten binary names
84
- shell : bash
85
100
run : |
86
101
sed -i.bak -e 's/haskell-language-server/hls/g' \
87
102
-e 's/haskell_language_server/hls/g' \
@@ -90,30 +105,26 @@ jobs:
90
105
src/**/*.hs exe/*.hs
91
106
92
107
- name : Build
93
- shell : bash
94
108
# Retry it three times to workaround compiler segfaults in windows
95
109
run : cabal build || cabal build || cabal build
96
110
97
111
- name : Test ghcide
98
112
if : ${{ !matrix.ghc-lib && matrix.test }}
99
- shell : bash
100
113
# run the tests without parallelism to avoid running out of memory
101
114
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"
102
115
103
116
- name : Test func-test suite
104
117
if : ${{ !matrix.ghc-lib && matrix.test }}
105
- shell : bash
106
118
env :
107
119
HLS_TEST_EXE : hls
108
120
HLS_WRAPPER_TEST_EXE : hls-wrapper
109
121
# run the tests without parallelism, otherwise tasty will attempt to run
110
122
# all functional test cases simultaneously which causes way too many hls
111
123
# 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"
113
125
114
126
- name : Test wrapper-test suite
115
127
if : ${{ !matrix.ghc-lib && matrix.test }}
116
- shell : bash
117
128
env :
118
129
HLS_TEST_EXE : hls
119
130
HLS_WRAPPER_TEST_EXE : hls-wrapper
0 commit comments