aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2022-05-04 16:16:47 +0100
committerJohn Levon <levon@movementarian.org>2022-05-09 23:28:10 +0100
commitf75110385495b8b580121e14afa5dfc9681a64a3 (patch)
tree41a70523b9d5a9003d317bba90210105e640aa72 /.github
parent17118f9b24eedb3380dad260dbd6a517392aaedb (diff)
downloadlibvfio-user-f75110385495b8b580121e14afa5dfc9681a64a3.zip
libvfio-user-f75110385495b8b580121e14afa5dfc9681a64a3.tar.gz
libvfio-user-f75110385495b8b580121e14afa5dfc9681a64a3.tar.bz2
github: add 'coverity.sh' script to replicate 'coverity' make target
Most of 'Makefile' will go away, but the 'coverity' target has a set of commands that are used to run a Coverity code check from GitHub workflows, or manually by maintainers. Putting this sequence of commands in a shell script removes the dep on 'make'. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to '.github')
-rwxr-xr-x.github/workflows/coverity.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/.github/workflows/coverity.sh b/.github/workflows/coverity.sh
new file mode 100755
index 0000000..76824f4
--- /dev/null
+++ b/.github/workflows/coverity.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -e
+set -v
+
+if test -z "$COVERITY_TOKEN"
+then
+ echo "COVERITY_TOKEN environment variable must be set"
+ exit 1
+fi
+
+if test -z "$COVERITY_EMAIL"
+then
+ echo "COVERITY_EMAIL environment variable must be set"
+ exit 1
+fi
+
+GIT_SHA=$(git rev-parse --short HEAD)
+
+curl -sS -L -o coverity.tar.gz \
+ -d "token=$COVERITY_TOKEN&project=nutanix%2Flibvfio-user" \
+ https://scan.coverity.com/download/cxx/linux64
+
+tar xf coverity.tar.gz
+
+meson build/coverity || (cat build/meson-logs/meson-log.txt && exit 1)
+./cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C build/coverity -v
+
+tar czf coverity-results.tar.gz cov-int
+
+curl --form token=$COVERITY_TOKEN \
+ --form email=$COVERITY_EMAIL \
+ --form file=@coverity-results.tar.gz \
+ --form version=$GIT_SHA \
+ https://scan.coverity.com/builds?project=nutanix%2Flibvfio-user