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
This commit is contained in:
Stefan Schmidt 2019-06-25 12:11:33 -04:00 committed by Mike Blumenkrantz
parent 8103b56874
commit 4f0989f290
8 changed files with 51 additions and 1 deletions

View File

@ -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" \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

4
.ci/coverity-tools-install.sh Executable file
View File

@ -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

8
.ci/coverity-upload.sh Executable file
View File

@ -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

View File

@ -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