Skip to content

Build linux binaries in alpine container #2463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Builds

defaults:
run:
shell: bash

on:
release:
types: [created]
Expand All @@ -14,7 +10,10 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}

container: ${{ (matrix.os == 'ubuntu-18.04' && 'alpine:3.12') || '' }}
defaults:
run:
shell: ${{ (matrix.os == 'windows-latest' && 'bash') || 'sh' }}
strategy:
fail-fast: false
matrix:
Expand All @@ -23,13 +22,26 @@ jobs:
cabal: ['3.6']

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

- uses: haskell/actions/setup@v1
with:
ghc-version : ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

# some alpines come with integer-simple instead of integer-gmp
- name: Force integer-simple
if: matrix.os == 'ubuntu-18.04'
run: |
if ghc --info | grep -q integer-simple ; then
echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local
fi

- name: Use modified cabal.project for ghc9
if: ${{ matrix.ghc == '9.0.1' }}
run: cp cabal-ghc901.project cabal.project
Expand Down Expand Up @@ -74,8 +86,8 @@ jobs:
- name: Build server
# Try building it twice in case of flakey builds on Windows
run: |
cabal build exe:hls -O2 $LINUX_CABAL_ARGS || \
cabal build exe:hls -O2 $LINUX_CABAL_ARGS -j1
cabal build --disable-tests exe:hls -O2 $LINUX_CABAL_ARGS || \
cabal build --disable-tests exe:hls -O2 $LINUX_CABAL_ARGS -j1

- name: Compress server binary
id: compress_server_binary
Expand Down Expand Up @@ -114,7 +126,7 @@ jobs:

- name: Build wrapper
if: matrix.ghc == '8.10.7'
run: cabal build exe:hls-wrapper -O2 $LINUX_CABAL_ARGS
run: cabal build --disable-tests exe:hls-wrapper -O2 $LINUX_CABAL_ARGS

- name: Compress wrapper binary
if: matrix.ghc == '8.10.7'
Expand Down