From 4f0989f2904c20ad2768b8244190b82b701c0564 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Tue, 25 Jun 2019 12:11:33 -0400 Subject: [PATCH] ci: travis: add coverity build job to be run from cron Summary: We finally have regular Coverity Scan runs back to our CI. It gets triggered from the cron jobs on Travis. As we are not able to identify if it comes from a daily or weekly cron build I added a check to only run the scan build on a Saturday so we should have a nice and fresh report on Monday morning in our mailboxes. Reviewers: zmike, bu5hm4n Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9175 --- .ci/ci-configure.sh | 16 ++++++++++++++++ .ci/ci-make-benchmark.sh | 3 +++ .ci/ci-make-check.sh | 4 ++++ .ci/ci-make-install.sh | 3 +++ .ci/ci-make.sh | 11 ++++++++++- .ci/coverity-tools-install.sh | 4 ++++ .ci/coverity-upload.sh | 8 ++++++++ .travis.yml | 3 +++ 8 files changed, 51 insertions(+), 1 deletion(-) create mode 100755 .ci/coverity-tools-install.sh create mode 100755 .ci/coverity-upload.sh diff --git a/.ci/ci-configure.sh b/.ci/ci-configure.sh index 7802c6b409..cc1f8497d0 100755 --- a/.ci/ci-configure.sh +++ b/.ci/ci-configure.sh @@ -56,6 +56,17 @@ if [ "$DISTRO" != "" ] ; then OPTS="$OPTS $RELEASE_READY_LINUX_COPTS" fi + if [ "$1" = "coverity" ]; then + if [ $(date +%A) != "Saturday" ]; then + echo "Not Saturday so we are not running our weekly Coverity scan build." + exit 0 + fi + OPTS="$OPTS $WAYLAND_LINUX_COPTS" + travis_fold cov-download cov-download + docker exec --env COVERITY_SCAN_TOKEN=$COVERITY_SCAN_TOKEN $(cat $HOME/cid) sh -c '.ci/coverity-tools-install.sh' + travis_endfold cov-download + fi + if [ "$1" = "mingw" ]; then OPTS="$OPTS $MINGW_COPTS" travis_fold cross-native cross-native @@ -65,6 +76,11 @@ if [ "$DISTRO" != "" ] ; then docker exec --env EIO_MONITOR_POLL=1 --env PKG_CONFIG_PATH="/ewpi-64-install/lib/pkgconfig/" \ $(cat $HOME/cid) sh -c "mkdir build && meson build $OPTS" travis_endfold meson + elif [ "$1" = "coverity" ]; then + travis_fold meson meson + docker exec --env EIO_MONITOR_POLL=1 --env CFLAGS="-fdirectives-only" --env CC="gcc" --env CXX="g++"\ + --env CXXFLAGS="-fdirectives-only" $(cat $HOME/cid) sh -c "mkdir build && meson build $OPTS" + travis_endfold meson else travis_fold meson meson docker exec --env EIO_MONITOR_POLL=1 --env CC="ccache gcc" \ diff --git a/.ci/ci-make-benchmark.sh b/.ci/ci-make-benchmark.sh index d1689a2844..1fe0f9796f 100755 --- a/.ci/ci-make-benchmark.sh +++ b/.ci/ci-make-benchmark.sh @@ -5,6 +5,9 @@ set -e if [ "$1" = "release-ready" ] ; then exit 0 fi +if [ "$1" = "coverity" ] ; then + exit 0 +fi travis_fold benchmark "ninja benchmark" echo "Nothing to do here, the benchmarks don't seem to terminate" #else diff --git a/.ci/ci-make-check.sh b/.ci/ci-make-check.sh index d331993315..36f1f2de58 100755 --- a/.ci/ci-make-check.sh +++ b/.ci/ci-make-check.sh @@ -9,6 +9,10 @@ if [ "$1" = "mingw" ] ; then exit 0 fi +if [ "$1" = "coverity" ] ; then + exit 0 +fi + #T7151 if [ "$1" = "options-enabled" ] || [ "$1" = "options-disabled" ] ; then exit 0 diff --git a/.ci/ci-make-install.sh b/.ci/ci-make-install.sh index 0984b06cb9..74769896c3 100755 --- a/.ci/ci-make-install.sh +++ b/.ci/ci-make-install.sh @@ -5,6 +5,9 @@ set -e if [ "$1" = "release-ready" ] ; then exit 0 fi +if [ "$1" = "coverity" ] ; then + exit 0 +fi travis_fold install "ninja install" if [ "$DISTRO" != "" ] ; then docker exec --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) ninja -C build install diff --git a/.ci/ci-make.sh b/.ci/ci-make.sh index 0e955bc4a7..70b56490cc 100755 --- a/.ci/ci-make.sh +++ b/.ci/ci-make.sh @@ -7,7 +7,16 @@ if [ "$1" = "release-ready" ] ; then fi travis_fold ninja ninja if [ "$DISTRO" != "" ] ; then - docker exec --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) ninja -C build + if [ "$1" = "coverity" ] ; then + if [ $(date +%A) != "Saturday" ]; then + exit 0 + fi + docker exec --env EIO_MONITOR_POLL=1 --env PATH="/src/cov-analysis-linux64-2019.03/bin:$PATH" $(cat $HOME/cid) sh -c "cov-build --dir cov-int ninja -C build" + docker exec --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) sh -c "tar caf efl-$(git rev-parse --short HEAD).xz cov-int" + docker exec --env EIO_MONITOR_POLL=1 --env COVERITY_SCAN_TOKEN=$COVERITY_SCAN_TOKEN $(cat $HOME/cid) sh -c ".ci/coverity-upload.sh" + else + docker exec --env EIO_MONITOR_POLL=1 $(cat $HOME/cid) ninja -C build + fi else export PATH="$(brew --prefix gettext)/bin:$PATH" ninja -C build diff --git a/.ci/coverity-tools-install.sh b/.ci/coverity-tools-install.sh new file mode 100755 index 0000000000..08dd9d1811 --- /dev/null +++ b/.ci/coverity-tools-install.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +wget https://scan.coverity.com/download/linux64 --post-data="token=$COVERITY_SCAN_TOKEN&project=Enlightenment+Foundation+Libraries" -O coverity_tool.tgz +tar xzf coverity_tool.tgz diff --git a/.ci/coverity-upload.sh b/.ci/coverity-upload.sh new file mode 100755 index 0000000000..0b68bcb70b --- /dev/null +++ b/.ci/coverity-upload.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +curl --form token=$COVERITY_SCAN_TOKEN \ + --form email=stefan@datenfreihafen.org \ + --form file=@efl-$(git rev-parse --short HEAD).xz \ + --form version=$(git rev-parse --short HEAD) \ + --form description="Submission from Travis CI" \ + https://scan.coverity.com/builds?project=Enlightenment+Foundation+Libraries diff --git a/.travis.yml b/.travis.yml index dbd3f6c3d7..749f55d6f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,6 +67,9 @@ jobs: - os: linux if: type = cron env: DISTRO=Debian96 + - os: linux + if: type = cron + env: DISTRO=Fedora30 CI_BUILD_TYPE=coverity services: - docker