@@ -26,12 +26,12 @@ jobs:
2626 strategy :
2727 fail-fast : false
2828 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"]
3131 os : [ubuntu-latest, macOS-latest, windows-latest]
3232 exclude :
3333 - os : windows-latest
34- ghc-version : ' 8.8.3'
34+ ghc : ' 8.8.3'
3535
3636 steps :
3737 - uses : actions/checkout@v2
4141 - uses : haskell/actions/setup@v1
4242 id : HaskEnvSetup
4343 with :
44- ghc-version : ${{ matrix.ghc-version }}
45- cabal-version : ${{ matrix.cabal-version }}
44+ ghc-version : ${{ matrix.ghc }}
45+ cabal-version : ${{ matrix.cabal }}
4646
4747 - if : runner.os == 'Windows'
4848 name : (Windows) Platform config
@@ -55,16 +55,26 @@ jobs:
5555 echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
5656
5757 # 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`
6060 run : cp cabal-ghc901.project cabal.project
6161
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
6464 run : |
6565 echo "package floskell" >> cabal.project
6666 echo " ghc-options: -O0" >> cabal.project
6767
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+
6878 - name : Retrieving `cabal.project` Hackage timestamp
6979 run : |
7080 TIMESTAMP="$(grep index-state cabal.project)"
@@ -88,25 +98,15 @@ jobs:
8898 cache-name : compiled-deps
8999 with :
90100 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') }}
92102 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 }}-
105105
106106 - name : Build
107107 run : cabal v2-build --enable-tests --enable-benchmarks --only-dependencies
108108
109109 # repeating builds to workaround segfaults in windows and ghc-8.8.4
110110 - if : runner.os == 'Windows'
111- name : (Windows) Run build additional 2 times
111+ name : (Windows) Run build 2 additional times
112112 run : cabal v2-build --enable-tests --enable-benchmarks --only-dependencies || cabal v2-build --enable-tests --enable-benchmarks --only-dependencies
0 commit comments