19
19
- master
20
20
21
21
jobs :
22
+
22
23
pre_job :
23
24
runs-on : ubuntu-latest
24
25
outputs :
37
38
cancel_others : false
38
39
paths_ignore : ' ["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]'
39
40
40
- deps :
41
+ caching :
41
42
if : needs.pre_job.outputs.should_skip != 'true'
42
43
needs : pre_job
43
44
runs-on : ${{ matrix.os }}
@@ -55,34 +56,45 @@ jobs:
55
56
- uses : actions/checkout@v2
56
57
with :
57
58
submodules : true
59
+
58
60
- uses : haskell/actions/setup@v1
59
61
with :
60
- ghc-version : ${{ matrix.ghc }}
62
+ ghc-version : ${{ matrix.ghc }}
61
63
cabal-version : ${{ matrix.cabal }}
62
64
63
- - if : matrix .os == 'windows-latest '
64
- name : Set some window specific things
65
+ - if : runner .os == 'Windows '
66
+ name : (Windows) Platform config
65
67
run : |
66
68
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
67
69
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
68
-
69
- - if : matrix.os != 'windows-latest'
70
- name : Set some linux/macOS specific things
70
+ - if : ( runner.os == 'Linux' ) || ( runner.os == 'macOS' )
71
+ name : (Linux,macOS) Platform config
71
72
run : |
72
73
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
73
74
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
74
75
75
76
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
76
77
- if : matrix.ghc == '9.0.1'
77
- name : Use modified cabal.project for ghc9
78
- run : cp cabal-ghc901.project cabal.project
79
-
80
- - if : matrix.ghc == '8.8.4 ' && matrix.os == 'windows-latest '
81
- name : Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
78
+ name : (GHC 9.0.1) Use modified ` cabal.project`
79
+ run : |
80
+ cp cabal-ghc901.project cabal.project
81
+ - if : runner.os == 'Windows ' && matrix.ghc == '8.8.4 '
82
+ name : (Windows,GHC 8.8) Modify ` cabal.project` to workaround segfaults
82
83
run : |
83
84
echo "package floskell" >> cabal.project
84
85
echo " ghc-options: -O0" >> cabal.project
85
86
87
+ # Shorten binary names as a workaround for filepath length limits in Windows,
88
+ # but since tests are hardcoded on this workaround -
89
+ # all platforms (in 2021-12-07) need it.
90
+ - name : Workaround shorten binary names
91
+ run : |
92
+ sed -i.bak -e 's/haskell-language-server/hls/g' \
93
+ -e 's/haskell_language_server/hls/g' \
94
+ haskell-language-server.cabal cabal.project
95
+ sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
96
+ src/**/*.hs exe/*.hs
97
+
86
98
- name : Cache Cabal
87
99
uses : actions/cache@v2
88
100
env :
@@ -99,15 +111,6 @@ jobs:
99
111
100
112
- run : cabal update
101
113
102
- # Need this to work around filepath length limits in Windows
103
- - name : Shorten binary names
104
- run : |
105
- sed -i.bak -e 's/haskell-language-server/hls/g' \
106
- -e 's/haskell_language_server/hls/g' \
107
- haskell-language-server.cabal cabal.project
108
- sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
109
- src/**/*.hs exe/*.hs
110
-
111
114
# repeating builds to workaround segfaults in windows and ghc-8.8.4
112
115
- name : Build
113
116
run : cabal build --only-dependencies || cabal build --only-dependencies || cabal build --only-dependencies
0 commit comments