Skip to content

Commit 36c75b6

Browse files
committed
[CI] Add Alpine builders
Signed-off-by: AeroStun <[email protected]>
1 parent b2be9b7 commit 36c75b6

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,61 @@ jobs:
313313
with:
314314
name: libSMCE-windows-${{ matrix.compiler.c }}
315315
path: build/packages/*
316+
build-alpine:
317+
name: libSMCE - Alpine (${{ matrix.compiler.name }})
318+
runs-on: ubuntu-latest
319+
container: alpine:latest
320+
strategy:
321+
fail-fast: false
322+
matrix:
323+
compiler:
324+
- name: GCC
325+
c: gcc
326+
cxx: g++
327+
pkgs: [ g++ ]
328+
- name: Clang/LLVM
329+
c: clang
330+
cxx: clang++
331+
pkgs: [ clang, compiler-rt, compiler-rt-static, lld, libstdc++, musl-dev ]
332+
env:
333+
CC: ${{ matrix.compiler.c }}
334+
CXX: ${{ matrix.compiler.cxx }}
335+
steps:
336+
- run: cd ~
337+
- uses: actions/checkout@v3
338+
- name: Check deps
339+
run: |
340+
apk update
341+
apk upgrade
342+
apk add git ninja cmake ${{ join(matrix.compiler.pkgs, ' ') }}
343+
apk add wget linux-headers openssl-dev mosquitto-dev
344+
if [ "${{ matrix.compiler.c }}" = "clang" ]; then
345+
apk fetch --stdout g++ | tar xzvf - -C/ usr/lib # grab libstdc++
346+
fi
347+
- name: Install arduino-prelude APK
348+
run: |
349+
wget -O arduino-prelude.apk https://github.com/ItJustWorksTM/arduino-prelude/releases/download/v1.0.2/arduino-prelude-1.0.2-r0-x86_64.apk
350+
apk add --allow-untrusted ./arduino-prelude.apk
351+
rm arduino-prelude.apk
352+
- name: CMake configure
353+
run: |
354+
if [ "${{ matrix.compiler.c }}" = "clang" ]; then
355+
echo '' > AlpineClangToolchain.cmake
356+
for key in EXE SHARED MODULE; do
357+
echo "set (CMAKE_${key}_LINKER_FLAGS \"-fuse-ld=lld --rtlib=compiler-rt\")" >> AlpineClangToolchain.cmake
358+
done
359+
export CMAKE_TOOLCHAIN_FILE="$(pwd)/AlpineClangToolchain.cmake"
360+
fi
361+
cmake -G Ninja \
362+
-DCMAKE_BUILD_TYPE=Release \
363+
-S ./ -B ./build
364+
- name: CMake build
365+
run: cmake --build ./build
366+
- name: Build & Run tests
367+
run: |
368+
cmake --build ./build --target SMCE_Tests
369+
cd build/test
370+
ctest --output-on-failure
316371
build-arch:
317372
name: libSMCE - ArchLinux (${{ matrix.compiler.name }})
318373
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)