[epiphany/mcatanzaro/xss-gnome-40: 12/13] ci: add script to run scan-build




commit a4ae0238ec83c771b4a5a28b7d0c45698f76399c
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Wed Dec 15 13:09:30 2021 -0600

    ci: add script to run scan-build
    
    This lets us pass our own args to scan-build. In particular, we can
    make scan-build fail when it detects a problem, instead of manually
    inspecting whether it created an HTML report.
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1045>

 .gitlab-ci.yml  | 2 +-
 .run-scan-build | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ea232f962..ba84e802c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,7 +47,7 @@ scanbuild:
   script:
     - mkdir _build
     - meson ${CONFIG_OPTS} _build
-    - ninja -C _build scan-build
+    - SCANBUILD=$(pwd)/.run-scan-build ninja -C _build scan-build
     - bash -c 'if [[ -n "$(ls -A _build/meson-logs/scanbuild/)" ]]; then echo "Scan build log found, 
assuming defects exist"; exit 1; fi'
   artifacts:
     when: on_failure
diff --git a/.run-scan-build b/.run-scan-build
new file mode 100755
index 000000000..88fe82454
--- /dev/null
+++ b/.run-scan-build
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+scan-build -v --status-bugs "$@"


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