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 5028db3 commit f926053
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ jobs:
submodules: recursive
- run: sudo gem install apt-spy2 && sudo apt-spy2 fix
- run: sudo apt-get update -y
- run: sudo apt-get install -o Acquire::Retries=5 -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- run: sudo apt-get install -o Acquire::Retries=5 -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu qemu-user-static
- run: cmake -DCMAKE_TOOLCHAIN_FILE=CMakeARM64Cross.txt
- run: make -j4 VERBOSE=1
- run: make -j4 test ARGS=-V
armv7:
runs-on: ubuntu-latest
steps:
Expand All @@ -45,9 +46,10 @@ jobs:
submodules: recursive
- run: sudo gem install apt-spy2 && sudo apt-spy2 fix
- run: sudo apt-get update -y
- run: sudo apt-get install -o Acquire::Retries=5 -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
- run: sudo apt-get install -o Acquire::Retries=5 -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf qemu-user-static
- run: cmake -DCMAKE_TOOLCHAIN_FILE=CMakeARMCross.txt
- run: make -j4 VERBOSE=1
- 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 f926053

Please sign in to comment.