diff options
-rwxr-xr-x | .github/workflows/coverity.sh | 35 |
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 |