From d940352da7ebc8c8e0d9399bbd3515e145f54c39 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 3 Sep 2021 19:26:11 +0000 Subject: [PATCH] gitlab-ci: enhance cppcheck display on CI build, the text output (and not xml) store all cppcheck output files on cppcheck folder (you need to launch cppcheck twice for generate txt and xml) --- .gitlab-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6daa9b9f83..b6c06d4cc6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -550,10 +550,12 @@ Code Checks + Clang Warnings: # build-ubuntu puts us in `build`. - cd .. - python3 tools/checklicenses.py - - ./tools/cppcheck/cppcheck.sh -l 1 -x | tee cppcheck_report.xml + - mkdir cppcheck + - ./tools/cppcheck/cppcheck.sh -l 1 | tee cppcheck/cppcheck_report.txt + - if [[ -s "cppcheck/cppcheck_report.txt" ]]; then ./tools/cppcheck/cppcheck.sh -l 1 -x > cppcheck/cppcheck_report.xml ; fi + - if [[ -s "cppcheck/cppcheck_report.txt" ]]; then cppcheck-htmlreport --file cppcheck/cppcheck_report.xml --report-dir cppcheck ; fi - ./tools/check_typed_item_calls.py --commits 1 | tee item_calls_check.txt - ./tools/check_tfs.py --commits 1 | tee tfs_check.txt - - if [[ -s "cppcheck_report.xml" ]]; then cppcheck-htmlreport --file cppcheck_report.xml --report-dir . ; fi - cd build - printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)" - cmake -DENABLE_EXTRA_COMPILER_WARNINGS=on -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DENABLE_CCACHE=ON -G Ninja .. @@ -567,8 +569,7 @@ Code Checks + Clang Warnings: paths: - clang_report.html - clang_analyzer_check.txt - - cppcheck_report.html - - cppcheck_report.xml + - cppcheck - item_calls_check.txt - tfs_check.txt - checkhf_conflict.txt