image: debian:stable stages: - build_and_test before_script: - export DEBIAN_FRONTEND=noninteractive - apt-get update -qq - > apt-get install -y -qq \ coreutils sudo \ build-essential make cmake binutils gcc autoconf automake \ libtool pkg-config git \ libpcap-dev libgpg-error-dev libjson-c-dev zlib1g-dev \ netcat-openbsd python3 python3-jsonschema tree lcov iproute2 after_script: - test -r /tmp/nDPIsrvd.log && cat /tmp/nDPIsrvd.log - test -r /tmp/nDPId.log && cat /tmp/nDPId.log build_and_test: script: # static linked build - mkdir build-cmake-submodule - cd build-cmake-submodule - env CMAKE_C_FLAGS='-Werror' cmake .. -DENABLE_SYSTEMD=ON -DENABLE_COVERAGE=ON -DBUILD_EXAMPLES=ON -DBUILD_NDPI=ON -DENABLE_SANITIZER=ON -DENABLE_ZLIB=ON - make libnDPI - tree libnDPI - make install VERBOSE=1 DESTDIR="$(realpath ../_install)" - cpack -G DEB - sudo dpkg -i nDPId-*.deb - cd .. - test -x /bin/systemctl && sudo systemctl daemon-reload - test -x /bin/systemctl && sudo systemctl enable ndpid@lo - test -x /bin/systemctl && sudo systemctl start ndpid@lo - test -x /bin/systemctl && sudo systemctl status ndpisrvd.service ndpid@lo.service - test -x /bin/systemctl && sudo systemctl stop ndpid@lo - ./test/run_tests.sh ./libnDPI ./build-cmake-submodule/nDPId-test # generate coverage report - make -C ./build-cmake-submodule coverage - > if ldd build/nDPId | grep -qoEi libndpi; then \ echo 'nDPId linked against a static libnDPI should not contain a shared linked libnDPI.' >&2; false; fi # pkg-config dynamic linked build - mkdir build - cd build - export PKG_CONFIG_PATH="$(realpath ../build-cmake-submodule/libnDPI/lib/pkgconfig)" - env CMAKE_C_FLAGS='-Werror' cmake .. -DBUILD_EXAMPLES=ON -DENABLE_SANITIZER=ON -DENABLE_MEMORY_PROFILING=ON -DENABLE_ZLIB=ON - make all VERBOSE=1 - cd .. - ./build/nDPId-test || test $? -eq 1 - ./build/nDPId -h || test $? -eq 1 # dameon start/stop test - NUSER=nobody make -C ./build daemon VERBOSE=1 - NUSER=nobody make -C ./build daemon VERBOSE=1 # make dist - make -C ./build dist artifacts: expire_in: 1 week paths: - _install/ stage: build_and_test