|
8 | 8 | - '*-check-build'
|
9 | 9 |
|
10 | 10 | jobs:
|
11 |
| - build-mac-win: |
12 |
| - defaults: |
13 |
| - run: |
14 |
| - shell: bash |
| 11 | + build: |
15 | 12 | runs-on: ${{ matrix.os }}
|
| 13 | + container: ${{ (matrix.os == 'ubuntu-18.04' && 'alpine:3.12') || '' }} |
16 | 14 | strategy:
|
17 | 15 | fail-fast: false
|
18 | 16 | matrix:
|
19 | 17 | ghc: ['9.0.1', '8.10.7', '8.10.6', '8.8.4', '8.6.5']
|
20 |
| - os: [macOS-latest, windows-latest] |
| 18 | + os: [ubuntu-18.04, macOS-latest, windows-latest] |
21 | 19 | cabal: ['3.6']
|
22 | 20 |
|
23 | 21 | steps:
|
| 22 | + - name: Install system dependencies |
| 23 | + if: matrix.os == 'ubuntu-18.04' |
| 24 | + run: | |
| 25 | + apk add --no-cache curl gcc g++ gmp-dev ncurses-dev libffi-dev make xz gzip tar perl git bash sudo binutils-gold |
| 26 | + apk add --no-cache zlib zlib-dev zlib-static gmp gmp-dev ncurses-static |
24 | 27 | - uses: actions/checkout@v2
|
25 | 28 | with:
|
26 | 29 | submodules: true
|
|
29 | 32 | ghc-version : ${{ matrix.ghc }}
|
30 | 33 | cabal-version: ${{ matrix.cabal }}
|
31 | 34 |
|
| 35 | + # some alpines come with integer-simple instead of integer-gmp |
| 36 | + - name: Force integer-simple |
| 37 | + if: matrix.os == 'ubuntu-18.04' |
| 38 | + run: | |
| 39 | + if ghc --info | grep -q integer-simple ; then |
| 40 | + echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local |
| 41 | + fi |
| 42 | +
|
32 | 43 | - name: Use modified cabal.project for ghc9
|
33 | 44 | if: ${{ matrix.ghc == '9.0.1' }}
|
34 | 45 | run: cp cabal-ghc901.project cabal.project
|
| 46 | + shell: bash |
35 | 47 |
|
36 | 48 | - name: Shorten binary names
|
37 | 49 | run: |
|
|
40 | 52 | haskell-language-server.cabal cabal.project
|
41 | 53 | sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
|
42 | 54 | src/**/*.hs exe/*.hs
|
| 55 | + shell: bash |
43 | 56 |
|
44 | 57 | - name: Set some window specific things
|
45 | 58 | if: matrix.os == 'windows-latest'
|
|
48 | 61 | run: |
|
49 | 62 | echo "EXE_EXT=.exe" >> $GITHUB_ENV
|
50 | 63 | echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
|
| 64 | + shell: bash |
51 | 65 |
|
52 | 66 | - name: Set some linux specific things
|
53 | 67 | if: matrix.os == 'ubuntu-18.04'
|
@@ -78,134 +92,7 @@ jobs:
|
78 | 92 |
|
79 | 93 | - name: Compress server binary
|
80 | 94 | id: compress_server_binary
|
81 |
| - run: | |
82 |
| - HLS_BUILD=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f) |
83 |
| - HLS=haskell-language-server-${{env.GHC_VERSION}} |
84 |
| - mv $HLS_BUILD $HLS${{env.EXE_EXT}} |
85 |
| - if [[ "$OSTYPE" == "msys" ]]; then |
86 |
| - 7z a $HLS.zip $HLS${{env.EXE_EXT}} |
87 |
| - echo ::set-output name=path::$HLS.zip |
88 |
| - echo ::set-output name=content_type::application/zip |
89 |
| - echo ::set-output name=extension::zip |
90 |
| - else |
91 |
| - gzip --best $HLS |
92 |
| - echo ::set-output name=path::$HLS.gz |
93 |
| - echo ::set-output name=content_type::application/gzip |
94 |
| - echo ::set-output name=extension::gz |
95 |
| - fi |
96 |
| -
|
97 |
| - - name: Upload server to release |
98 |
| - if: ${{ !contains(github.ref_name, 'check') }} |
99 |
| - |
100 |
| - env: |
101 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
102 |
| - with: |
103 |
| - upload_url: ${{ github.event.release.upload_url }} |
104 |
| - asset_path: ${{ steps.compress_server_binary.outputs.path }} |
105 |
| - asset_name: haskell-language-server-${{ runner.OS }}-${{ env.GHC_VERSION }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }} |
106 |
| - asset_content_type: ${{ steps.compress_server_binary.outputs.content_type }} |
107 |
| - |
108 |
| - - name: Upload server to workflow artifacts |
109 |
| - uses: actions/upload-artifact@v2 |
110 |
| - with: |
111 |
| - name: haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }} |
112 |
| - path: ${{ steps.compress_server_binary.outputs.path }} |
113 |
| - |
114 |
| - - name: Build wrapper |
115 |
| - if: matrix.ghc == '8.10.7' |
116 |
| - run: cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS |
117 |
| - |
118 |
| - - name: Compress wrapper binary |
119 |
| - if: matrix.ghc == '8.10.7' |
120 |
| - id: compress_wrapper_binary |
121 |
| - run: | |
122 |
| - HLS_WRAPPER_BUILD=$(find dist-newstyle \( -name 'hls-wrapper' -o -name 'hls-wrapper.exe' \) -type f) |
123 |
| - HLS_WRAPPER=haskell-language-server-wrapper |
124 |
| - mv $HLS_WRAPPER_BUILD $HLS_WRAPPER${{env.EXE_EXT}} |
125 |
| - if [[ "$OSTYPE" == "msys" ]]; then |
126 |
| - 7z a $HLS_WRAPPER.zip $HLS_WRAPPER${{env.EXE_EXT}} |
127 |
| - echo ::set-output name=path::$HLS_WRAPPER.zip |
128 |
| - echo ::set-output name=content_type::application/zip |
129 |
| - echo ::set-output name=extension::zip |
130 |
| - else |
131 |
| - gzip --best $HLS_WRAPPER |
132 |
| - echo ::set-output name=path::$HLS_WRAPPER.gz |
133 |
| - echo ::set-output name=content_type::application/gzip |
134 |
| - echo ::set-output name=extension::gz |
135 |
| - fi |
136 |
| -
|
137 |
| - - name: Upload wrapper to the release |
138 |
| - if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }} |
139 |
| - |
140 |
| - env: |
141 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
142 |
| - with: |
143 |
| - upload_url: ${{ github.event.release.upload_url }} |
144 |
| - asset_path: ${{ steps.compress_wrapper_binary.outputs.path }} |
145 |
| - asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }} |
146 |
| - asset_content_type: ${{ steps.compress_wrapper_binary.outputs.content_type}} |
147 |
| - |
148 |
| - - name: Upload wrapper to workflow artifacts |
149 |
| - uses: actions/upload-artifact@v2 |
150 |
| - if: matrix.ghc == '8.10.7' |
151 |
| - with: |
152 |
| - name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }} |
153 |
| - path: ${{ steps.compress_wrapper_binary.outputs.path }} |
154 |
| - |
155 |
| - build-linux: |
156 |
| - runs-on: ubuntu-latest |
157 |
| - container: alpine:3.12 |
158 |
| - |
159 |
| - strategy: |
160 |
| - fail-fast: false |
161 |
| - matrix: |
162 |
| - ghc: ['9.0.1', '8.10.7', '8.10.6', '8.8.4', '8.6.5'] |
163 |
| - cabal: ['3.6'] |
164 |
| - |
165 |
| - steps: |
166 |
| - - name: Install system dependencies |
167 |
| - run: | |
168 |
| - apk add --no-cache curl gcc g++ gmp-dev ncurses-dev libffi-dev make xz gzip tar perl git bash sudo binutils-gold |
169 |
| - apk add --no-cache zlib zlib-dev zlib-static gmp gmp-dev ncurses-static |
170 |
| - - uses: actions/checkout@v2 |
171 |
| - - uses: haskell/actions/setup@v1 |
172 |
| - with: |
173 |
| - ghc-version : ${{ matrix.ghc }} |
174 |
| - cabal-version: ${{ matrix.cabal }} |
175 |
| -# some alpines need workaround |
176 |
| - - name: Force integer-simple |
177 |
| - run: | |
178 |
| - if ghc --info | grep -q integer-simple ; then |
179 |
| - echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local |
180 |
| - fi |
181 |
| - - name: Use modified cabal.project for ghc9 |
182 |
| - if: ${{ matrix.ghc == '9.0.1' }} |
183 |
| - run: cp cabal-ghc901.project cabal.project |
184 |
| - |
185 |
| - - name: Shorten binary names |
186 |
| - run: | |
187 |
| - sed -i.bak -e 's/haskell-language-server/hls/g' \ |
188 |
| - -e 's/haskell_language_server/hls/g' \ |
189 |
| - haskell-language-server.cabal cabal.project |
190 |
| - sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \ |
191 |
| - src/**/*.hs exe/*.hs |
192 |
| -
|
193 |
| - - name: Set some linux specific things |
194 |
| - if: matrix.os == 'ubuntu-18.04' |
195 |
| - env: |
196 |
| - GHC_VER: ${{ matrix.ghc }} |
197 |
| - run: | |
198 |
| - echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV |
199 |
| - echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV |
200 |
| -
|
201 |
| - - name: Build server |
202 |
| - # Try building it twice in case of flakey builds on Windows |
203 |
| - run: | |
204 |
| - cabal build exe:hls -O2 $LINUX_CABAL_ARGS || \ |
205 |
| - cabal build exe:hls -O2 $LINUX_CABAL_ARGS -j1 |
206 |
| -
|
207 |
| - - name: Compress server binary |
208 |
| - id: compress_server_binary |
| 95 | + shell: bash |
209 | 96 | run: |
|
210 | 97 | HLS_BUILD=$(find dist-newstyle \( -name 'hls' -o -name 'hls.exe' \) -type f)
|
211 | 98 | HLS=haskell-language-server-${{env.GHC_VERSION}}
|
|
0 commit comments