From 0a08a6a7c0e75e24097a32eae3c006ab69cd8432 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Mon, 4 May 2020 14:16:06 +0200 Subject: [PATCH] ci: Run clang scan-build test as part of CI --- .gitlab-ci.yml | 17 +++++++++++++++++ .gitlab-ci/libfprint-templates.yaml | 1 + .gitlab-ci/scan-build | 4 ++++ 3 files changed, 22 insertions(+) create mode 100755 .gitlab-ci/scan-build diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 338b035..52df2b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,6 +75,23 @@ test_valgrind: - ninja -C _build - meson test -C _build --verbose --no-stdsplit --setup=valgrind +test_scan_build: + stage: test + except: + variables: + - $CI_PIPELINE_SOURCE == "schedule" + allow_failure: true + script: + - meson -Ddrivers=all . _build + # This is ugly, the wrapper disables the malloc checker + - SCANBUILD=$CI_PROJECT_DIR/.gitlab-ci/scan-build ninja -C _build scan-build + # Check that the directory is empty + - "! ls -A _build/meson-logs/scanbuild | grep -q ." + artifacts: + paths: + - _build/meson-logs + expire_in: 1 week + test_indent: stage: check-source except: diff --git a/.gitlab-ci/libfprint-templates.yaml b/.gitlab-ci/libfprint-templates.yaml index e8a510f..0d1cb6a 100644 --- a/.gitlab-ci/libfprint-templates.yaml +++ b/.gitlab-ci/libfprint-templates.yaml @@ -24,3 +24,4 @@ umockdev uncrustify valgrind + clang-analyzer diff --git a/.gitlab-ci/scan-build b/.gitlab-ci/scan-build new file mode 100755 index 0000000..be40871 --- /dev/null +++ b/.gitlab-ci/scan-build @@ -0,0 +1,4 @@ +#!/bin/sh + +# This wrapper just disables the malloc checker +exec /usr/bin/scan-build -disable-checker unix.Malloc "$@" \ No newline at end of file