From f75110385495b8b580121e14afa5dfc9681a64a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 4 May 2022 16:16:47 +0100 Subject: github: add 'coverity.sh' script to replicate 'coverity' make target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- .github/workflows/coverity.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 .github/workflows/coverity.sh (limited to '.github') 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 -- cgit v1.1