Commit 510afc17 authored by Claudio André's avatar Claudio André

CI: save cppcheck result as artifacts

It might be needed or useful.
parent 30874cb7
......@@ -18,6 +18,7 @@ stages:
- $(pwd)/.cache/jhbuild/build/gjs/config.log
- $(pwd)/.cache/jhbuild/build/gjs/Makefile
- $(pwd)/coverage/
- $(pwd)/cppcheck/
script:
# Run static code analysis OR
......
......@@ -61,8 +61,10 @@ echo "Doing: $1"
source test/extra/do_jhbuild.sh
# Create the coverage artifacts folders
# Create the artifacts folders
mkdir -p $(pwd)/coverage; touch $(pwd)/coverage/doing-"$1"
mkdir -p $(pwd)/cppcheck; touch $(pwd)/cppcheck/doing-"$1"
save_dir=$(pwd)
if [[ $1 == "GJS" ]]; then
do_Set_Env
......@@ -121,16 +123,16 @@ elif [[ $1 == "CPPCHECK" ]]; then
echo
echo '-- Static code analyzer report --'
cppcheck --inline-suppr --enable=warning,performance,portability,information,missingInclude --force -q . 2>&1 | \
sed -E 's/:[0-9]+]/:LINE]/' | tee /cwd/current-report.txt
tee "$save_dir"/cppcheck/current-report.txt | sed -E 's/:[0-9]+]/:LINE]/' | tee /cwd/current-report.txt
echo
echo '-- Master static code analyzer report --'
git clone --depth 1 https://gitlab.gnome.org/GNOME/gjs.git tmp-upstream; cd tmp-upstream || exit 1
cppcheck --inline-suppr --enable=warning,performance,portability,information,missingInclude --force -q . 2>&1 | \
sed -E 's/:[0-9]+]/:LINE]/' | tee /cwd/master-report.txt
tee "$save_dir"/cppcheck/master-report.txt | sed -E 's/:[0-9]+]/:LINE]/' | tee /cwd/master-report.txt
echo
# Compare the report with master and fails if new warnings is found
# Compare the report with master and fails if new warnings are found
if ! diff --brief /cwd/master-report.txt /cwd/current-report.txt > /dev/null; then
echo '----------------------------------------'
echo '### New warnings found by cppcheck ###'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment