diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25c0260218b762186bc31394d236bebdde43a340..5c5b1557b525ef942628a3a5adda3845c4520271 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ stages: - CMake/generate.py -wm - mkdir release - cd release - - cmake -DCMAKE_BUILD_TYPE=Release .. + - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. - make -j $(grep -c processor /proc/cpuinfo) artifacts: paths: @@ -124,9 +124,35 @@ build:doc: - doc/ expire_in: 1 day - #========== Stage test ========== +.static: &static + stage: test + image: amd64/debian:testing-slim + before_script: + - apt-get update + dependencies: + - build:debian:testing:clang + except: + variables: + - $SCHEDULED_NIGHTLY + allow_failure: true + +static:cppcheck: + <<: *static + script: + - apt-get install -y cppcheck + - cppcheck -q --enable=all --project=release/compile_commands.json --suppress="*:*/contrib/*" -j$(grep -c processor /proc/cpuinfo) --error-exitcode=1 + +static:clang-tidy: + <<: *static + script: + - apt-get install -y clang-tidy + - apt-get install -y libxml2-dev libtclap-dev libreadline-dev qtbase5-dev graphviz-dev libjsoncpp-dev + - find . -wholename "*/src/*.cpp" -print0 | xargs -n1 -P$(grep -c processor /proc/cpuinfo) -0 clang-tidy -warnings-as-errors='*' -p release/ + +# --- + .test: &test stage: test script: