]> git.gsnw.org Git - fping.git/commitdiff
move coverity scan to a script, so that it doesn't run for every job
authorDavid Schweikert <david@schweikert.ch>
Wed, 5 Aug 2020 06:01:38 +0000 (09:01 +0300)
committerDavid Schweikert <david@schweikert.ch>
Wed, 5 Aug 2020 06:01:38 +0000 (09:01 +0300)
.travis.yml
ci/deploy-coverity.sh [new file with mode: 0755]

index 829fa6085639fc02ec9cb0bb94f208b8daf9e5e9..4131fe843b3caf38cef221c5d55c815ce3834747 100644 (file)
@@ -26,13 +26,6 @@ addons:
     packages:
       - libcap2-bin
       - libtest-command-perl
-  coverity_scan:
-    project:
-      name: "schweikert/fping"
-      description: "Build submitted via Travis CI"
-    notification_email: david@schweikert.ch
-    build_command:   "ci/build-3-compile.sh"
-    branch_pattern: coverity_scan
     
 script:
   - ci/build-4-compile.sh
@@ -43,6 +36,7 @@ stages:
   - test
   - name: deploy
     if: branch = master OR branch = v4.x
+  - name: coverity
 
 jobs:
   include:
@@ -88,3 +82,11 @@ jobs:
       dist: xenial
       after_success:
         - ci/deploy-bintray.sh
+
+    #### STAGE: coverity
+    - stage: coverity
+      name: coverity
+      os: linux
+      dist: xenial
+      script:
+        - ci/deploy-coverity.sh
diff --git a/ci/deploy-coverity.sh b/ci/deploy-coverity.sh
new file mode 100755 (executable)
index 0000000..b009d2f
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+COVERITY_SCAN_PROJECT_NAME=schweikert/fping
+COVERITY_SCAN_EMAIL=david@schweikert.ch
+
+if [ -z "$COVERITY_SCAN_TOKEN" ]; then
+    echo "ERROR: COVERITY_SCAN_TOKEN not defined." >&2
+    exit 1
+fi
+
+curl -o /tmp/cov-analysis-linux64.tgz https://scan.coverity.com/download/linux64 \
+    --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN
+tar xfz /tmp/cov-analysis-linux64.tgz
+./autogen.sh
+./configure --enable-ipv4 --enable-ipv6 --enable-safe-limits --prefix=/opt/fping
+cov-analysis-linux64-*/bin/cov-build --dir cov-int make -j4
+tar cfz cov-int.tar.gz cov-int
+curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME \
+    --form token=$COVERITY_SCAN_TOKEN \
+    --form email=$COVERITY_SCAN_EMAIL \
+    --form file=@cov-int.tar.gz \
+    --form version="`git rev-parse --short HEAD`" \
+    --form description="`git rev-parse --short HEAD` / $TRAVIS_BUILD_ID "