Skip to content

Commit c570656

Browse files
authored
Build linux binaries in alpine container (#2463)
* Build linux binaries in alpine container * fix submodules * install system deps * force integer-simple * Merge build-mac-win and build-linux * --disable-tests * default shell
1 parent f128085 commit c570656

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Builds
22

3-
defaults:
4-
run:
5-
shell: bash
6-
73
on:
84
release:
95
types: [created]
@@ -14,7 +10,10 @@ on:
1410
jobs:
1511
build:
1612
runs-on: ${{ matrix.os }}
17-
13+
container: ${{ (matrix.os == 'ubuntu-18.04' && 'alpine:3.12') || '' }}
14+
defaults:
15+
run:
16+
shell: ${{ (matrix.os == 'windows-latest' && 'bash') || 'sh' }}
1817
strategy:
1918
fail-fast: false
2019
matrix:
@@ -23,13 +22,26 @@ jobs:
2322
cabal: ['3.6']
2423

2524
steps:
25+
- name: Install system dependencies
26+
if: matrix.os == 'ubuntu-18.04'
27+
run: |
28+
apk add --no-cache curl gcc g++ gmp-dev ncurses-dev libffi-dev make xz gzip tar perl git bash sudo binutils-gold
29+
apk add --no-cache zlib zlib-dev zlib-static gmp gmp-dev ncurses-static
2630
- uses: actions/checkout@v2
2731

2832
- uses: haskell/actions/setup@v1
2933
with:
3034
ghc-version : ${{ matrix.ghc }}
3135
cabal-version: ${{ matrix.cabal }}
3236

37+
# some alpines come with integer-simple instead of integer-gmp
38+
- name: Force integer-simple
39+
if: matrix.os == 'ubuntu-18.04'
40+
run: |
41+
if ghc --info | grep -q integer-simple ; then
42+
echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local
43+
fi
44+
3345
- name: Use modified cabal.project for ghc9
3446
if: ${{ matrix.ghc == '9.0.1' }}
3547
run: cp cabal-ghc901.project cabal.project
@@ -74,8 +86,8 @@ jobs:
7486
- name: Build server
7587
# Try building it twice in case of flakey builds on Windows
7688
run: |
77-
cabal build exe:hls -O2 $LINUX_CABAL_ARGS || \
78-
cabal build exe:hls -O2 $LINUX_CABAL_ARGS -j1
89+
cabal build --disable-tests exe:hls -O2 $LINUX_CABAL_ARGS || \
90+
cabal build --disable-tests exe:hls -O2 $LINUX_CABAL_ARGS -j1
7991
8092
- name: Compress server binary
8193
id: compress_server_binary
@@ -114,7 +126,7 @@ jobs:
114126

115127
- name: Build wrapper
116128
if: matrix.ghc == '8.10.7'
117-
run: cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS
129+
run: cabal build --disable-tests exe:hls-wrapper -O2 $LINUX_CABAL_ARGS
118130

119131
- name: Compress wrapper binary
120132
if: matrix.ghc == '8.10.7'

0 commit comments

Comments
 (0)