[gjs: 1/2] CI: run code analyzers on its own parallel build



commit 91c7be193bce27b172e905b0312721a86a577860
Author: Claudio André <claudioandre br gmail com>
Date:   Tue Nov 7 14:48:28 2017 -0200

    CI: run code analyzers on its own parallel build
    
    They don't need to actually build the code to run.

 .gitlab-ci.yml  | 16 ++++++++++++++--
 test/test-ci.sh | 15 ++++++++-------
 2 files changed, 22 insertions(+), 9 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 93341d1..01e25c6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,8 +17,13 @@ before_script:
     - $(pwd)/.cache/jhbuild/build/gjs/test-suite.log
 
   script:
+    # Run static code analysis OR
     # Build dependencies and 'make check' gjs
-    - $(pwd)/test/test-ci.sh GJS
+    - 'if [[ -n "${CODECHECK}" ]]; then
+         $(pwd)/test/test-ci.sh "$CODECHECK";
+       else
+         $(pwd)/test/test-ci.sh GJS;
+       fi'
 
     # Run extra tests
     - 'if [[ $BUILD_OPTS == *"--enable-installed-tests"* ]]; then
@@ -43,9 +48,16 @@ fedora_gcc:
     BASE: fedora
     OS: fedora.26.gcc
     CC: gcc
-    CPPCHECK: "yes"
     BUILD_OPTS: "--enable-ubsan"
 
+fedora_cppcheck:
+  <<: *build
+  image: claudioandre/spidermonkey:fedora.26.gcc
+  variables:
+    BASE: fedora
+    OS: fedora.26.gcc
+    CODECHECK: "CPPCHECK"
+
 # Failure routine
 on_failure:
   stage: failure
diff --git a/test/test-ci.sh b/test/test-ci.sh
index ab4c34e..864890c 100755
--- a/test/test-ci.sh
+++ b/test/test-ci.sh
@@ -268,13 +268,6 @@ elif [[ $1 == "GJS" ]]; then
     echo
     jhbuild make --check
 
-    if [[ $CPPCHECK == "yes" ]]; then
-        echo
-        echo '-- Code analyzer --'
-        jhbuild run --in-builddir=gjs make cppcheck
-        echo
-    fi
-
 elif [[ $1 == "GJS_EXTRA" ]]; then
     # Extra testing. It doesn't build, just run the 'Installed Tests'
     echo
@@ -284,6 +277,14 @@ elif [[ $1 == "GJS_EXTRA" ]]; then
 
     xvfb-run jhbuild run dbus-run-session -- gnome-desktop-testing-runner gjs
 
+elif [[ $1 == "CPPCHECK" ]]; then
+    do_Install_Base_Dependencies
+
+    echo
+    echo '-- Code analyzer --'
+    cppcheck --enable=warning,performance,portability,information,missingInclude --force -q .
+    echo
+
 else
     echo
     echo '-- NOTHING TO DO --'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]