aboutsummaryrefslogtreecommitdiff
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
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>
-rw-r--r--.github/workflows/coverity.yml21
-rw-r--r--Makefile8
2 files changed, 29 insertions, 0 deletions
diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml
new file mode 100644
index 0000000..ab33388
--- /dev/null
+++ b/.github/workflows/coverity.yml
@@ -0,0 +1,21 @@
+name: coverity
+on:
+ push:
+ branches:
+ - master
+
+jobs:
+ coverity:
+ timeout-minutes: 5
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v2
+ - name: run-scan
+ run: |
+ sudo apt-get update
+ sudo apt-get -y install libjson-c-dev libcmocka-dev clang valgrind \
+ python3-pytest debianutils
+ make coverity VERBOSE=1
+ env:
+ COVERITY_TOKEN: ${{ secrets.COVERITY_TOKEN }}
+ COVERITY_EMAIL: ${{ secrets.COVERITY_EMAIL }}
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)