Skip to content

Add musl libc CI using Alpine Linux container on Ubuntu GHA #25

Add musl libc CI using Alpine Linux container on Ubuntu GHA

Add musl libc CI using Alpine Linux container on Ubuntu GHA #25

Workflow file for this run

name: Alpine Linux (musl libc)
on:
- pull_request
- push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Alpine Linux (musl libc)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 50
- name: Setup latest Alpine Linux
uses: jirutka/setup-alpine@v1
- name: Install dependencies
run:
apk update && apk add --no-cache \
ldc \
git \
g++ \
cmake \
ninja \
llvm-dev \
llvm-static \
libunwind-static \
libxml2-static \
zstd-static \
zlib-static \
bash \
grep \
diffutils \
make
shell: alpine.sh --root {0}
# TODO: Add '-DLLVM_IS_SHARED=OFF' when static linking is fully supported
- name: Build LDC & LDC D unittests & defaultlib unittest runners
run: |
set -eux
cmake -G Ninja . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/opt/ldc2" \
-DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ \
-DD_COMPILER_FLAGS=-link-defaultlib-shared=false \
-DBUILD_SHARED_LIBS=OFF
ninja obj/ldc2.o all ldc2-unittest all-test-runners
bin/ldc2 --version
ldd bin/ldc2
shell: alpine.sh {0}
- name: Run LDC D unittests
if: success() || failure()
run: ctest --output-on-failure -R "ldc2-unittest"
shell: alpine.sh {0}
- name: Run LIT testsuite
if: success() || failure()
run: |
set -eux
ctest -V -R "lit-tests"
shell: alpine.sh {0}
- name: Run DMD testsuite
if: success() || failure()
run: ctest -V -R "dmd-testsuite"
shell: alpine.sh {0}
- name: Run defaultlib unittests & druntime integration tests
if: success() || failure()
run: |
set -eux
ctest -j$(nproc) --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest"
shell: alpine.sh {0}