From c8e1d1b7a5f08bae19f8e4c9f826ff07a0b2c1d5 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 9 Jan 2024 10:24:02 +0100 Subject: [PATCH] Extend CI pipeline build and test. Signed-off-by: Toni Uhlig --- .github/workflows/build.yml | 20 ++++++++++---------- CMakeLists.txt | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a7f87e74..1785fcbbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,9 +116,9 @@ jobs: poll: "-DFORCE_POLL=OFF" upload: false ndpi_min_version: "4.8" - - compiler: "cc" + - compiler: "clang" os: "macOS-latest" - ndpi_build: "-DBUILD_NDPI=OFF" + ndpi_build: "-DBUILD_NDPI=ON" ndpid_examples: "-DBUILD_EXAMPLES=OFF" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=OFF" ndpid_zlib: "-DENABLE_ZLIB=ON" @@ -155,12 +155,12 @@ jobs: - name: Install MacOS Prerequisites if: startsWith(matrix.os, 'macOS') run: | - brew install coreutils flock automake make unzip - wget 'https://www.tcpdump.org/release/libpcap-1.10.4.tar.gz' - tar -xzvf libpcap-1.10.4.tar.gz - cd libpcap-1.10.4 - ./configure && make install - cd .. + brew install coreutils flock automake make unzip cmake pkg-config git wget + #wget 'https://www.tcpdump.org/release/libpcap-1.10.4.tar.gz' + #tar -xzvf libpcap-1.10.4.tar.gz + #cd libpcap-1.10.4 + #./configure && make install + #cd .. wget 'https://github.com/ntop/nDPI/archive/refs/heads/dev.zip' -O libndpi-dev.zip unzip libndpi-dev.zip cd nDPI-dev @@ -194,9 +194,9 @@ jobs: run: | cmake --build build --verbose - name: Build single nDPId executable (invoke CC directly) - if: (endsWith(matrix.compiler, 'gcc') || endsWith(matrix.compiler, 'clang')) && startsWith(matrix.coverage, '-DENABLE_COVERAGE=OFF') && startsWith(matrix.sanitizer, '-DENABLE_SANITIZER=ON') && startsWith(matrix.ndpid_gcrypt, '-DNDPI_WITH_GCRYPT=OFF') && startsWith(matrix.ndpid_zlib, '-DENABLE_ZLIB=ON') + if: endsWith(matrix.compiler, 'gcc-7') == false && startsWith(matrix.coverage, '-DENABLE_COVERAGE=OFF') && startsWith(matrix.sanitizer, '-DENABLE_SANITIZER=ON') && startsWith(matrix.ndpid_gcrypt, '-DNDPI_WITH_GCRYPT=OFF') && startsWith(matrix.ndpid_zlib, '-DENABLE_ZLIB=ON') run: | - cc -Wall -Wextra -std=gnu99 -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=enum -fsanitize=leak nDPId.c nio.c utils.c -I./build/libnDPI/include/ndpi -I. -I./dependencies -I./dependencies/jsmn -I./dependencies/uthash/include -o /tmp/a.out -lpcap ./build/libnDPI/lib/libndpi.a -pthread -lm -lz + cc -Wall -Wextra -std=gnu99 ${{ matrix.poll }} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=enum -fsanitize=leak nDPId.c nio.c utils.c -I./build/libnDPI/include/ndpi -I. -I./dependencies -I./dependencies/jsmn -I./dependencies/uthash/include -o /tmp/a.out -lpcap ./build/libnDPI/lib/libndpi.a -pthread -lm -lz - name: Test EXEC run: | ./build/nDPId-test diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ed9b2db5..d701d4fa4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -233,7 +233,7 @@ else() endif() if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g3 -fno-omit-frame-pointer -fno-inline") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g3 -fno-omit-frame-pointer") endif() if(ENABLE_SANITIZER AND ENABLE_SANITIZER_THREAD)