@@ -26,12 +26,12 @@ jobs:
26
26
strategy :
27
27
fail-fast : false
28
28
matrix :
29
- ghc-version : ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.8.3", "8.6.5"]
30
- cabal-version : ["3.4"]
29
+ ghc : ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.8.3", "8.6.5"]
30
+ cabal : ["3.4"]
31
31
os : [ubuntu-latest, macOS-latest, windows-latest]
32
32
exclude :
33
33
- os : windows-latest
34
- ghc-version : ' 8.8.3'
34
+ ghc : ' 8.8.3'
35
35
36
36
steps :
37
37
- uses : actions/checkout@v2
41
41
- uses : haskell/actions/setup@v1
42
42
id : HaskEnvSetup
43
43
with :
44
- ghc-version : ${{ matrix.ghc-version }}
45
- cabal-version : ${{ matrix.cabal-version }}
44
+ ghc-version : ${{ matrix.ghc }}
45
+ cabal-version : ${{ matrix.cabal }}
46
46
47
47
- if : runner.os == 'Windows'
48
48
name : (Windows) Platform config
@@ -55,16 +55,26 @@ jobs:
55
55
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
56
56
57
57
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
58
- - if : matrix.ghc-version == '9.0.1'
59
- name : Use modified cabal.project for ghc9
58
+ - if : matrix.ghc == '9.0.1'
59
+ name : (GHC 9.0.1) Use modified ` cabal.project`
60
60
run : cp cabal-ghc901.project cabal.project
61
61
62
- - if : matrix.ghc-version == '8.8.4 ' && matrix.os == 'windows-latest '
63
- name : Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
62
+ - if : runner.os == 'Windows ' && matrix.ghc == '8.8.4 '
63
+ name : (Windows,GHC 8.8) Modify ` cabal.project` to workaround segfaults
64
64
run : |
65
65
echo "package floskell" >> cabal.project
66
66
echo " ghc-options: -O0" >> cabal.project
67
67
68
+ # Work around for filepath length limits in Windows
69
+ - if : runner.os == 'Windows'
70
+ name : (Windows) Shorten binary names
71
+ run : |
72
+ sed -i.bak -e 's/haskell-language-server/hls/g' \
73
+ -e 's/haskell_language_server/hls/g' \
74
+ haskell-language-server.cabal cabal.project
75
+ sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
76
+ src/**/*.hs exe/*.hs
77
+
68
78
- name : Retrieving `cabal.project` Hackage timestamp
69
79
run : |
70
80
TIMESTAMP="$(grep index-state cabal.project)"
@@ -88,25 +98,15 @@ jobs:
88
98
cache-name : compiled-deps
89
99
with :
90
100
path : ${{ steps.HaskEnvSetup.outputs.cabal-store }}
91
- key : ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.HACKAGE_TIMESTAMP }}-${{ hashFiles('cabal.project') }}
101
+ key : ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.HACKAGE_TIMESTAMP }}-${{ hashFiles('cabal.project') }}
92
102
restore-keys : |
93
- ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc-version }}-${{ env.HACKAGE_TIMESTAMP }}-
94
- ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc-version }}-
95
-
96
- # Work around for filepath length limits in Windows
97
- - if : runner.os == 'Windows'
98
- name : (Windows) Shorten binary names
99
- run : |
100
- sed -i.bak -e 's/haskell-language-server/hls/g' \
101
- -e 's/haskell_language_server/hls/g' \
102
- haskell-language-server.cabal cabal.project
103
- sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
104
- src/**/*.hs exe/*.hs
103
+ ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-${{ env.HACKAGE_TIMESTAMP }}-
104
+ ${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
105
105
106
106
- name : Build
107
107
run : cabal v2-build --enable-tests --enable-benchmarks --only-dependencies
108
108
109
109
# repeating builds to workaround segfaults in windows and ghc-8.8.4
110
110
- if : runner.os == 'Windows'
111
- name : (Windows) Run build additional 2 times
111
+ name : (Windows) Run build 2 additional times
112
112
run : cabal v2-build --enable-tests --enable-benchmarks --only-dependencies || cabal v2-build --enable-tests --enable-benchmarks --only-dependencies
0 commit comments