optionally try covertiy_scan with every build on master

idea from https://github.com/umlaeute/Gem/blob/master/.travis.yml
This commit is contained in:
Frank Morgner 2018-04-07 12:08:08 +02:00
parent 491e5a47fc
commit e1bc515363
1 changed files with 21 additions and 15 deletions

View File

@ -15,19 +15,17 @@ addons:
- xsltproc - xsltproc
- gengetopt - gengetopt
- help2man - help2man
coverity_scan:
project:
name: "OpenSC/OpenSC"
description: "Build submitted via Travis CI"
notification_email: viktor.tarasov@gmail.com
build_command: "make -j 4"
branch_pattern: coverity_scan
env: env:
global: global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key # via the "travis encrypt" command using the project repo's public key
- secure: "UkHn7wy4im8V1nebCWbAetnDSOLRUbOlF6++ovk/7Bnso1/lnhXHelyzgRxfD/oI68wm9nnRV+RQEZ9+72Ug1CyvHxyyxxkwal/tPeHH4B/L+aGdPi0id+5OZSKIm77VP3m5s102sJMJgH7DFd03+nUd0K26p0tk8ad4j1geV4c=" - secure: "UkHn7wy4im8V1nebCWbAetnDSOLRUbOlF6++ovk/7Bnso1/lnhXHelyzgRxfD/oI68wm9nnRV+RQEZ9+72Ug1CyvHxyyxxkwal/tPeHH4B/L+aGdPi0id+5OZSKIm77VP3m5s102sJMJgH7DFd03+nUd0K26p0tk8ad4j1geV4c="
- COVERITY_SCAN_BRANCH_PATTERN="(master|coverity.*)"
- COVERITY_SCAN_NOTIFICATION_EMAIL="viktor.tarasov@gmail.com"
- COVERITY_SCAN_BUILD_COMMAND="make -j 4"
- COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
- SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
matrix: matrix:
fast_finish: true fast_finish: true
@ -46,6 +44,8 @@ matrix:
env: HOST=x86_64-w64-mingw32 env: HOST=x86_64-w64-mingw32
- os: linux - os: linux
env: HOST=i686-w64-mingw32 env: HOST=i686-w64-mingw32
- os: linux
env: DO_COVERITY_SCAN=yes
before_install: before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then - if [ "$TRAVIS_OS_NAME" == "osx" ]; then
@ -56,10 +56,12 @@ before_install:
fi fi
before_script: before_script:
# we run a weekly cron job in travis on the coverity branch - if [ "${DO_COVERITY_SCAN}" == "yes" ]; then
# just synchronize it with master to get a new report if ! curl -s 'https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh' | bash;
- if [ "${COVERITY_SCAN_BRANCH}" == 1 ]; then # coverity could not be initialized; propably quota is exhausted
git reset --hard origin/master; # just continue with the normal CI build
true;
fi;
fi fi
- ./bootstrap - ./bootstrap
- if [ -z "$HOST" ]; then - if [ -z "$HOST" ]; then
@ -77,17 +79,21 @@ before_script:
fi fi
script: script:
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then - if [ "${DO_COVERITY_SCAN}" != "yes" ]; then
if [ $TRAVIS_OS_NAME == osx ]; then if [ $TRAVIS_OS_NAME == osx ]; then
./MacOSX/build; ./MacOSX/build;
else else
if curl -s 'https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh' | bash;
make; make;
else
true;
fi;
fi; fi;
fi fi
- if [ -z "$HOST" -a "${COVERITY_SCAN_BRANCH}" != 1 ]; then - if [ -z "$HOST" -a "${DO_COVERITY_SCAN}" != "yes" ]; then
make check && make dist; make check && make dist;
fi fi
- if [ ! -z "$HOST" -a "${COVERITY_SCAN_BRANCH}" != 1 ]; then - if [ ! -z "$HOST" -a "${DO_COVERITY_SCAN}" != "yes" ]; then
make install; make install;
wine "C:/Program Files (x86)/Inno Setup 5/ISCC.exe" win32/OpenSC.iss; wine "C:/Program Files (x86)/Inno Setup 5/ISCC.exe" win32/OpenSC.iss;
fi fi