From 3111d8ec3ed5557b64434778fb2596908235bfa2 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 20 Oct 2021 16:36:53 +0100 Subject: add coverity scan support in github action (#612) On a push to master branch, trigger a run and upload. Signed-off-by: John Levon Reviewed-by: Swapnil Ingle --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Makefile') 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) -- cgit v1.1