Skip to content

Commit

Permalink
ci: test aarch64 and armv7 static binaries with qemu-user-static
Browse files Browse the repository at this point in the history
  • Loading branch information
darkk committed Sep 25, 2024
1 parent affedf2 commit 469ce62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
- run: sudo apt-get install -o Acquire::Retries=5 -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- run: cmake -DCMAKE_TOOLCHAIN_FILE=CMakeARM64Cross.txt
- run: make -j4 VERBOSE=1
- run: sudo apt-get install -o Acquire::Retries=5 -y qemu-user-static
- run: make -j4 test ARGS=-V
armv7:
runs-on: ubuntu-latest
steps:
Expand All @@ -48,6 +50,8 @@ jobs:
- run: sudo apt-get install -o Acquire::Retries=5 -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
- run: cmake -DCMAKE_TOOLCHAIN_FILE=CMakeARMCross.txt
- run: make -j4 VERBOSE=1
- run: sudo apt-get install -o Acquire::Retries=5 -y qemu-user-static
- run: make -j4 test ARGS=-V
macOS:
name: macOS
runs-on: macOS-latest
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,15 @@ SET(exectargets ${exectargets} SMHasher)
#
# target_link_libraries( bittest SMHasherSupport ${CMAKE_THREAD_LIBS_INIT} )

if(NOT (CMAKE_CROSSCOMPILING))
set(QEMU_TESTING FALSE)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
exec_program(cat ARGS "/proc/sys/fs/binfmt_misc/qemu-${CMAKE_SYSTEM_PROCESSOR}" OUTPUT_VARIABLE QEMU)
if(QEMU MATCHES "^enabled\n")
set(QEMU_TESTING TRUE)
endif()
endif()

if(NOT (CMAKE_CROSSCOMPILING) OR QEMU_TESTING)
enable_testing()
add_test(List SMHasher --list)
add_test(VerifyAll SMHasher --test=VerifyAll)
Expand Down

0 comments on commit 469ce62

Please sign in to comment.