Skip to content

Commit 45a4ba5

Browse files
authored
ci: Docker build for Alpine (#537)
Use GithubActions Docker build for Alpine builds. To avoid using `builds.sr.ht`. Closes: #476
1 parent 4acef34 commit 45a4ba5

2 files changed

Lines changed: 82 additions & 36 deletions

File tree

.builds/alpine.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.github/workflows/builds.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
working-directory: mac
3030
run: make -f Makefile-manual
3131

32+
3233
macos-cmake:
3334

3435
runs-on: macos-latest
@@ -94,6 +95,7 @@ jobs:
9495
cd build_meson
9596
ninja
9697
98+
9799
ubuntu-cmake:
98100

99101
runs-on: ubuntu-latest
@@ -157,6 +159,7 @@ jobs:
157159
cd build_meson
158160
ninja
159161
162+
160163
windows-cmake:
161164

162165
runs-on: windows-latest
@@ -276,6 +279,7 @@ jobs:
276279
cd build_meson
277280
ninja
278281
282+
279283
windows-msbuild:
280284

281285
runs-on: windows-latest
@@ -456,3 +460,81 @@ jobs:
456460
"-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
457461
cd build/static_test
458462
make install
463+
464+
465+
alpine:
466+
467+
runs-on: ubuntu-latest
468+
container: alpine:edge
469+
env:
470+
# A bug in musl: https://www.openwall.com/lists/musl/2020/01/20/2
471+
ALPINE_COMPILE_FLAGS: ${NIX_COMPILE_FLAGS} -Wno-overflow
472+
steps:
473+
- uses: actions/checkout@v3
474+
with:
475+
path: hidapisrc
476+
- name: Install dependencies
477+
run: |
478+
apk add gcc musl-dev autoconf automake libtool eudev-dev libusb-dev linux-headers cmake ninja make
479+
- name: Configure CMake
480+
run: |
481+
rm -rf build install
482+
cmake -B build/shared-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${ALPINE_COMPILE_FLAGS}"
483+
cmake -B build/static-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${ALPINE_COMPILE_FLAGS}"
484+
- name: Configure Automake
485+
working-directory: hidapisrc
486+
run: |
487+
./bootstrap
488+
./configure
489+
- name: Build CMake Shared
490+
working-directory: build/shared-cmake
491+
run: ninja install
492+
- name: Build CMake Static
493+
working-directory: build/static-cmake
494+
run: ninja install
495+
- name: Build Automake
496+
working-directory: hidapisrc
497+
run: |
498+
make
499+
make DESTDIR=$PWD/../install/automake install
500+
make clean
501+
- name: Build manual Makefile
502+
run: |
503+
cd hidapisrc/linux
504+
make -f Makefile-manual
505+
cd ../libusb
506+
make -f Makefile-manual
507+
- name: Check artifacts
508+
uses: andstor/file-existence-action@v2
509+
with:
510+
files: "install/shared-cmake/lib/libhidapi-libusb.so, \
511+
install/shared-cmake/lib/libhidapi-hidraw.so, \
512+
install/shared-cmake/include/hidapi/hidapi.h, \
513+
install/shared-cmake/include/hidapi/hidapi_libusb.h, \
514+
install/static-cmake/lib/libhidapi-libusb.a, \
515+
install/static-cmake/lib/libhidapi-hidraw.a, \
516+
install/static-cmake/include/hidapi/hidapi.h, \
517+
install/static-cmake/include/hidapi/hidapi_libusb.h"
518+
fail: true
519+
- name: Check CMake Export Package Shared
520+
run: |
521+
cmake \
522+
-GNinja \
523+
-B build/shared_test \
524+
-S hidapisrc/hidtest \
525+
-Dhidapi_ROOT=install/shared-cmake \
526+
-DCMAKE_INSTALL_PREFIX=install/shared_test \
527+
"-DCMAKE_C_FLAGS=${ALPINE_COMPILE_FLAGS}"
528+
cd build/shared_test
529+
ninja install
530+
- name: Check CMake Export Package Static
531+
run: |
532+
cmake \
533+
-GNinja \
534+
-B build/static_test \
535+
-S hidapisrc/hidtest \
536+
-Dhidapi_ROOT=install/static-cmake \
537+
-DCMAKE_INSTALL_PREFIX=install/static_test \
538+
"-DCMAKE_C_FLAGS=${ALPINE_COMPILE_FLAGS}"
539+
cd build/static_test
540+
ninja install

0 commit comments

Comments
 (0)