Skip to content

Commit 4acef34

Browse files
authored
ci: Docker build for Archlinux (#536)
Use GithubActions Docker build for Archlinux builds. To avoid using `builds.sr.ht`. Related: #476
1 parent df12234 commit 4acef34

2 files changed

Lines changed: 74 additions & 35 deletions

File tree

.builds/archlinux.yml

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

.github/workflows/builds.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,77 @@ jobs:
382382
"-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
383383
cd build/static_test
384384
ninja install
385+
386+
387+
archlinux:
388+
389+
runs-on: ubuntu-latest
390+
container: archlinux:latest
391+
steps:
392+
- uses: actions/checkout@v3
393+
with:
394+
path: hidapisrc
395+
- name: Install dependencies
396+
run: |
397+
pacman -Sy
398+
pacman -S --noconfirm gcc pkg-config autoconf automake libtool libusb libudev0 cmake make
399+
- name: Configure CMake
400+
run: |
401+
rm -rf build install
402+
cmake -B build/shared-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
403+
cmake -B build/static-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
404+
- name: Configure Automake
405+
working-directory: hidapisrc
406+
run: |
407+
./bootstrap
408+
./configure
409+
- name: Build CMake Shared
410+
working-directory: build/shared-cmake
411+
run: make install
412+
- name: Build CMake Static
413+
working-directory: build/static-cmake
414+
run: make install
415+
- name: Build Automake
416+
working-directory: hidapisrc
417+
run: |
418+
make
419+
make DESTDIR=$PWD/../install/automake install
420+
make clean
421+
- name: Build manual Makefile
422+
run: |
423+
cd hidapisrc/linux
424+
make -f Makefile-manual
425+
cd ../libusb
426+
make -f Makefile-manual
427+
- name: Check artifacts
428+
uses: andstor/file-existence-action@v2
429+
with:
430+
files: "install/shared-cmake/lib/libhidapi-libusb.so, \
431+
install/shared-cmake/lib/libhidapi-hidraw.so, \
432+
install/shared-cmake/include/hidapi/hidapi.h, \
433+
install/shared-cmake/include/hidapi/hidapi_libusb.h, \
434+
install/static-cmake/lib/libhidapi-libusb.a, \
435+
install/static-cmake/lib/libhidapi-hidraw.a, \
436+
install/static-cmake/include/hidapi/hidapi.h, \
437+
install/static-cmake/include/hidapi/hidapi_libusb.h"
438+
fail: true
439+
- name: Check CMake Export Package Shared
440+
run: |
441+
cmake \
442+
-B build/shared_test \
443+
-S hidapisrc/hidtest \
444+
-Dhidapi_ROOT=install/shared-cmake \
445+
-DCMAKE_INSTALL_PREFIX=install/shared_test \
446+
"-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
447+
cd build/shared_test
448+
make install
449+
- name: Check CMake Export Package Static
450+
run: |
451+
cmake \
452+
-B build/static_test \
453+
-S hidapisrc/hidtest \
454+
-Dhidapi_ROOT=install/static-cmake \
455+
-DCMAKE_INSTALL_PREFIX=install/static_test \
456+
"-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
457+
cd build/static_test
458+
make install

0 commit comments

Comments
 (0)