Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage-utils:master commit in: /, travis/
Date: Fri, 03 Jan 2020 14:49:23
Message-Id: 1578062916.00c6d147bbeed3345c242d21fc237c10ddf0e023.grobian@gentoo
1 commit: 00c6d147bbeed3345c242d21fc237c10ddf0e023
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 3 14:48:36 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 3 14:48:36 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=00c6d147
7
8 travis: try testing on macOS, fix coverity run
9
10 This is guesswork, no way to test but push to Travis...
11
12 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
13
14 .travis.yml | 39 ++++++++++++++++++-------
15 travis/main.sh | 90 +++++++++++++++++++++-------------------------------------
16 2 files changed, 61 insertions(+), 68 deletions(-)
17
18 diff --git a/.travis.yml b/.travis.yml
19 index 97c8e85..981cd4d 100644
20 --- a/.travis.yml
21 +++ b/.travis.yml
22 @@ -2,18 +2,32 @@
23 # https://docs.travis-ci.com/
24
25 language: c
26 -# Order here matters for implicit matrix generation and coverity scan.
27 -# See travis/main.sh for details.
28 -compiler:
29 - - gcc
30 - - clang
31 -
32 sudo: false
33
34 -# Order here matters; see compiler comment above.
35 -os:
36 - - linux
37 -dist: xenial
38 +matrix:
39 + include:
40 + - compiler: gcc
41 + os: linux
42 + dist: bionic
43 + - compiler: clang
44 + os: linux
45 + dist: bionic
46 + - compiler: coverity
47 + os: linux
48 + dist: bionic
49 + env:
50 + - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
51 + - COVERITY_SCAN_BRANCH_PATTERN="master"
52 + - COVERITY_SCAN_NOTIFICATION_EMAIL="grobian@g.o"
53 + - COVERITY_SCAN_BUILD_COMMAND="make"
54 + - compiler: valgrind
55 + os: linux
56 + dist: bionic
57 + env:
58 + - CFLAGS="-g"
59 + - Q_RUN_WITH_VALGRIND=1
60 + - compiler: clang
61 + os: osx
62
63 env:
64 global:
65 @@ -25,6 +39,11 @@ addons:
66 - libgpgme11-dev
67 - gnupg2
68 - valgrind
69 + homebrew:
70 + packages:
71 + - gpgme
72 + - gnupg
73 + #update: true
74
75 before_install:
76 - ./travis/install-blake2.sh
77
78 diff --git a/travis/main.sh b/travis/main.sh
79 index 6f55073..52a3c90 100755
80 --- a/travis/main.sh
81 +++ b/travis/main.sh
82 @@ -2,65 +2,39 @@
83
84 . "${0%/*}"/lib.sh
85
86 -# We have to do this by hand rather than use the coverity addon because of
87 -# matrix explosion: https://github.com/travis-ci/travis-ci/issues/1975
88 -# We also do it by hand because when we're throttled, the addon will exit
89 -# the build immediately and skip the main script!
90 -coverity_scan() {
91 - local reason
92 - [[ ${TRAVIS_JOB_NUMBER} != *.1 ]] && reason="not first build job"
93 - [[ -n ${TRAVIS_TAG} ]] && reason="git tag"
94 - [[ ${TRAVIS_PULL_REQUEST} == "true" ]] && reason="pull request"
95 - if [[ -n ${reason} ]] ; then
96 - echo "Skipping coverity scan due to: ${reason}"
97 - return
98 - fi
99 +# For local deps like blake2b.
100 +export CPPFLAGS="-I${PWD}/../sysroot"
101 +export LDFLAGS="-L${PWD}/../sysroot"
102
103 - export COVERITY_SCAN_PROJECT_NAME="${TRAVIS_REPO_SLUG}"
104 - export COVERITY_SCAN_NOTIFICATION_EMAIL="grobian@g.o"
105 - export COVERITY_SCAN_BUILD_COMMAND="make -j${ncpus}"
106 - export COVERITY_SCAN_BUILD_COMMAND_PREPEND="git clean -q -x -d -f; git checkout -f"
107 - export COVERITY_SCAN_BRANCH_PATTERN="master"
108 +# ignore timestamps which git doesn't preserve
109 +# disable openmp because Clang's libomp isn't installed
110 +DEFARGS="--disable-maintainer-mode --disable-openmp"
111
112 - curl -s "https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh" | bash || :
113 -}
114 -
115 -main() {
116 - # For local deps like blake2b.
117 - export CPPFLAGS="-I${PWD}/../sysroot"
118 - export LDFLAGS="-L${PWD}/../sysroot"
119 -
120 - # ignore timestamps which git doesn't preserve
121 - # disable openmp because Clang's libomp isn't installed
122 - DEFARGS="--disable-maintainer-mode --disable-openmp"
123 -
124 - do_run() {
125 - v ./configure ${*}
126 -
127 - # Standard optimized build.
128 - m V=1
129 - m check
130 - m clean
131 - }
132 +do_run() {
133 + v ./configure ${*}
134
135 - do_run ${DEFARGS}
136 - do_run ${DEFARGS} --enable-qmanifest --enable-qtegrity
137 - do_run ${DEFARGS} --disable-qmanifest --enable-qtegrity
138 - do_run ${DEFARGS} --enable-qmanifest --disable-qtegrity
139 - do_run ${DEFARGS} --disable-qmanifest --disable-qtegrity
140 -
141 - if [[ ${TRAVIS_OS_NAME} == linux ]] ; then
142 - export Q_RUN_WITH_VALGRIND=1
143 - do_run CFLAGS=-g ${DEFARGS} --enable-qmanifest --enable-qtegrity
144 - fi
145 -
146 - # LSan needs sudo, which we don't use at the moment
147 - # Debug build w/ASAN and such enabled.
148 - #m debug
149 - #m check
150 -
151 - # Do scans last as they like to dirty the tree and some tests
152 - # expect a clean tree (like code style checks).
153 - v --fold="coverity_scan" coverity_scan
154 + # Standard optimized build.
155 + m V=1
156 + m check
157 + m clean
158 }
159 -main "$@"
160 +
161 +if [[ ${CC} == coverity ]] ; then
162 + [[ -n ${COVERITY_SCAN_TOKEN} ]] || exit 0; # don't fail on this for PRs
163 + # Do scans last as they like to dirty the tree and some tests
164 + # expect a clean tree (like code style checks).
165 + v --fold="coverity_scan" coverity_scan
166 + # ensure we end up with an existing compiler
167 + export CC=gcc
168 + v ./configure ${DEFARGS} --enable-qmanifest --enable-qtegrity
169 + curl -s 'https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh' | bash
170 +elif [[ ${CC} == valgrind ]] ; then
171 + export CC=gcc
172 + do_run CFLAGS=-g ${DEFARGS} --enable-qmanifest --enable-qtegrity
173 +else
174 + do_run ${DEFARGS}
175 + do_run ${DEFARGS} --enable-qmanifest --enable-qtegrity
176 + do_run ${DEFARGS} --disable-qmanifest --enable-qtegrity
177 + do_run ${DEFARGS} --enable-qmanifest --disable-qtegrity
178 + do_run ${DEFARGS} --disable-qmanifest --disable-qtegrity
179 +fi