commit:     00c6d147bbeed3345c242d21fc237c10ddf0e023
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  3 14:48:36 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Jan  3 14:48:36 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=00c6d147

travis: try testing on macOS, fix coverity run

This is guesswork, no way to test but push to Travis...

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 .travis.yml    | 39 ++++++++++++++++++-------
 travis/main.sh | 90 +++++++++++++++++++++-------------------------------------
 2 files changed, 61 insertions(+), 68 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 97c8e85..981cd4d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,18 +2,32 @@
 # https://docs.travis-ci.com/
 
 language: c
-# Order here matters for implicit matrix generation and coverity scan.
-# See travis/main.sh for details.
-compiler:
-  - gcc
-  - clang
-
 sudo: false
 
-# Order here matters; see compiler comment above.
-os:
-  - linux
-dist: xenial
+matrix:
+  include:
+    - compiler: gcc
+      os: linux
+      dist: bionic
+    - compiler: clang
+      os: linux
+      dist: bionic
+    - compiler: coverity
+      os: linux
+      dist: bionic
+      env:
+        - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
+        - COVERITY_SCAN_BRANCH_PATTERN="master"
+        - COVERITY_SCAN_NOTIFICATION_EMAIL="[email protected]"
+        - COVERITY_SCAN_BUILD_COMMAND="make"
+    - compiler: valgrind
+      os: linux
+      dist: bionic
+      env:
+        - CFLAGS="-g"
+        - Q_RUN_WITH_VALGRIND=1
+    - compiler: clang
+      os: osx
 
 env:
   global:
@@ -25,6 +39,11 @@ addons:
     - libgpgme11-dev
     - gnupg2
     - valgrind
+  homebrew:
+    packages:
+    - gpgme
+    - gnupg
+    #update: true
 
 before_install:
   - ./travis/install-blake2.sh

diff --git a/travis/main.sh b/travis/main.sh
index 6f55073..52a3c90 100755
--- a/travis/main.sh
+++ b/travis/main.sh
@@ -2,65 +2,39 @@
 
 . "${0%/*}"/lib.sh
 
-# We have to do this by hand rather than use the coverity addon because of
-# matrix explosion: https://github.com/travis-ci/travis-ci/issues/1975
-# We also do it by hand because when we're throttled, the addon will exit
-# the build immediately and skip the main script!
-coverity_scan() {
-       local reason
-       [[ ${TRAVIS_JOB_NUMBER} != *.1 ]] && reason="not first build job"
-       [[ -n ${TRAVIS_TAG} ]] && reason="git tag"
-       [[ ${TRAVIS_PULL_REQUEST} == "true" ]] && reason="pull request"
-       if [[ -n ${reason} ]] ; then
-               echo "Skipping coverity scan due to: ${reason}"
-               return
-       fi
+# For local deps like blake2b.
+export CPPFLAGS="-I${PWD}/../sysroot"
+export LDFLAGS="-L${PWD}/../sysroot"
 
-       export COVERITY_SCAN_PROJECT_NAME="${TRAVIS_REPO_SLUG}"
-       export COVERITY_SCAN_NOTIFICATION_EMAIL="[email protected]"
-       export COVERITY_SCAN_BUILD_COMMAND="make -j${ncpus}"
-       export COVERITY_SCAN_BUILD_COMMAND_PREPEND="git clean -q -x -d -f; git 
checkout -f"
-       export COVERITY_SCAN_BRANCH_PATTERN="master"
+# ignore timestamps which git doesn't preserve
+# disable openmp because Clang's libomp isn't installed
+DEFARGS="--disable-maintainer-mode --disable-openmp"
 
-       curl -s 
"https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh"; | bash || :
-}
-
-main() {
-       # For local deps like blake2b.
-       export CPPFLAGS="-I${PWD}/../sysroot"
-       export LDFLAGS="-L${PWD}/../sysroot"
-
-       # ignore timestamps which git doesn't preserve
-       # disable openmp because Clang's libomp isn't installed
-       DEFARGS="--disable-maintainer-mode --disable-openmp"
-
-       do_run() {
-               v ./configure ${*}
-
-               # Standard optimized build.
-               m V=1
-               m check
-               m clean
-       }
+do_run() {
+  v ./configure ${*}
 
-       do_run ${DEFARGS}
-       do_run ${DEFARGS} --enable-qmanifest --enable-qtegrity
-       do_run ${DEFARGS} --disable-qmanifest --enable-qtegrity
-       do_run ${DEFARGS} --enable-qmanifest --disable-qtegrity
-       do_run ${DEFARGS} --disable-qmanifest --disable-qtegrity
-
-       if [[ ${TRAVIS_OS_NAME} == linux ]] ; then
-               export Q_RUN_WITH_VALGRIND=1
-               do_run CFLAGS=-g ${DEFARGS} --enable-qmanifest --enable-qtegrity
-       fi
-
-       # LSan needs sudo, which we don't use at the moment
-       # Debug build w/ASAN and such enabled.
-       #m debug
-       #m check
-
-       # Do scans last as they like to dirty the tree and some tests
-       # expect a clean tree (like code style checks).
-       v --fold="coverity_scan" coverity_scan
+  # Standard optimized build.
+  m V=1
+  m check
+  m clean
 }
-main "$@"
+
+if [[ ${CC} == coverity ]] ; then
+  [[ -n ${COVERITY_SCAN_TOKEN} ]] || exit 0;  # don't fail on this for PRs
+  # Do scans last as they like to dirty the tree and some tests
+  # expect a clean tree (like code style checks).
+  v --fold="coverity_scan" coverity_scan
+  # ensure we end up with an existing compiler
+  export CC=gcc
+  v ./configure ${DEFARGS} --enable-qmanifest --enable-qtegrity
+  curl -s 'https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh' 
| bash
+elif [[ ${CC} == valgrind ]] ; then
+  export CC=gcc
+  do_run CFLAGS=-g ${DEFARGS} --enable-qmanifest --enable-qtegrity
+else
+  do_run ${DEFARGS}
+  do_run ${DEFARGS} --enable-qmanifest --enable-qtegrity
+  do_run ${DEFARGS} --disable-qmanifest --enable-qtegrity
+  do_run ${DEFARGS} --enable-qmanifest --disable-qtegrity
+  do_run ${DEFARGS} --disable-qmanifest --disable-qtegrity
+fi

Reply via email to