aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn Levon <john.levon@nutanix.com>2021-10-20 16:36:53 +0100
committerGitHub <noreply@github.com>2021-10-20 16:36:53 +0100
commit3111d8ec3ed5557b64434778fb2596908235bfa2 (patch)
tree553f4b23d994f19885505929b006428692a18c6b /Makefile
parent5590ea8eb54e9f653b55b70f95e0793898e1955c (diff)
downloadlibvfio-user-3111d8ec3ed5557b64434778fb2596908235bfa2.zip
libvfio-user-3111d8ec3ed5557b64434778fb2596908235bfa2.tar.gz
libvfio-user-3111d8ec3ed5557b64434778fb2596908235bfa2.tar.bz2
add coverity scan support in github action (#612)
On a push to master branch, trigger a run and upload. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a33dbb8..11900cb 100644
--- a/Makefile
+++ b/Makefile
@@ -52,6 +52,7 @@ ifeq ($(VERBOSE),)
MAKEFLAGS += -s
endif
+GIT_SHA = $(shell git rev-parse --short HEAD)
CMAKE = $(shell bash -c "command -v cmake3 cmake" | head -1)
RSTLINT= $(shell bash -c "command -v restructuredtext-lint /bin/true" | head -1)
@@ -135,6 +136,13 @@ pre-push: realclean
make pytest-valgrind
make install DESTDIR=tmp.install
+coverity: realclean
+ 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
+ ./cov-analysis-linux64-*/bin/cov-build --dir cov-int make -j4 all
+ 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
+
GCOVS=$(patsubst %.c,%.c.gcov, $(wildcard lib/*.c))
gcov: realclean test $(GCOVS)