Skip to content

Commit a7d9456

Browse files
committed
Re-enable Coverity static analysis
Manual execution of travisci_build_coverity_scan.sh as a workaround for not building on every job of the build matrix
1 parent 852d66d commit a7d9456

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

.travis.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ matrix:
1616
# GCC on Linux
1717
##########################################################################
1818

19+
# Coverity static code analysis
20+
- dist: bionic
21+
env:
22+
- COVERITY_SCAN_PROJECT_NAME=SRombauts/SQLiteCpp
23+
- COVERITY_SCAN_BRANCH_PATTERN=master
24+
25+
- COVERITY_SCAN_BUILD_COMMAND_PREPEND="cmake ."
26+
- COVERITY_SCAN_BUILD_COMMAND="make -j8"
27+
# Encrypted COVERITY_SCAN_TOKEN, created via the "travis encrypt" command using the project repo's public key
28+
- secure: "Qm4d8NEDPBtYZCYav46uPEvDCtaRsjLXlkVS+C+WCJAPcwXCGkrr96wEi7RWcq2xD86QCh0XiqaPT+xdUmlohOYIovRhaaBmZ1lwIJ4GsG/ZR6xoFr3DYsZ3o4GyXk2vNXNxEl82AC+Xs6e6gkLOV9XRkBcjpVIvoIXgNlKWeGY="
29+
1930
# GCC Debug build with GCov for coverage build
2031
- dist: bionic
2132
env:
@@ -91,17 +102,17 @@ matrix:
91102
- ASAN=ON
92103

93104
before_install:
94-
# Set the compiler environment variables properly
95-
- export CC=${cc}
96-
- export CXX=${cxx}
97-
- ${CC} --version
98-
- ${CXX} --version
99-
- if [[ "$VALGRIND" == "true" ]]; then sudo apt-get install -qq valgrind ; fi
105+
# Coverity: don't use addons.coverity_scan since it run on every job of the build matrix, which waste resources and exhausts quotas
106+
# Note: the job dedicated to Coverity need to only run the shell script and then exit (to not try to build and run unit tests etc.)
107+
- if [[ -n "$COVERITY_SCAN_PROJECT_NAME" ]] ; then curl -s https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh | bash ; exit 0 ; fi
100108

101-
install:
102-
# coveralls test coverage:
109+
- if [[ "$VALGRIND" == "true" ]]; then sudo apt-get install -qq valgrind ; fi
103110
- if [[ "$COVERALLS" == "true" ]]; then pip install --user cpp-coveralls ; fi
104111

112+
# Set the compiler environment variables properly
113+
- export CC=${cc}
114+
- export CXX=${cxx}
115+
105116
# scripts to run before build
106117
before_script:
107118
- mkdir build

0 commit comments

Comments
 (0)