-
Notifications
You must be signed in to change notification settings - Fork 516
/
.travis.yml
174 lines (142 loc) · 5.44 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Copyright (c) 2012-2023 Sebastien Rombauts (sebastien.rombauts@gmail.com)
language: cpp
# Use Linux unless specified otherwise
os: linux
cache:
apt: true
env:
global:
- BUILD_TYPE=Debug
- ASAN=ON
- INTERNAL_SQLITE=ON
- VALGRIND=OFF
- TESTS=ON
- SHARED_LIBS=OFF
# Build variants (should test a reasonable number of combination of CMake options)
jobs:
include:
##########################################################################
# GCC on Linux
##########################################################################
# GCC 11.2.0 (Ubuntu Jammy 22.04)
- dist: jammy
env:
- cc=gcc cxx=g++
# Clang 9.3.0 (Ubuntu Focal 20.04)
- dist: focal
env:
- cc=gcc cxx=g++
# Coverity static code analysis (Ubuntu Bionic 18.04)
- dist: bionic
env:
- COVERITY_SCAN_PROJECT_NAME=SRombauts/SQLiteCpp
- COVERITY_SCAN_BRANCH_PATTERN=master
- COVERITY_SCAN_NOTIFICATION_EMAIL=sebastien.rombauts@gmail.com
- COVERITY_SCAN_BUILD_COMMAND_PREPEND="cmake ."
- COVERITY_SCAN_BUILD_COMMAND="make -j8"
# Encrypted COVERITY_SCAN_TOKEN, created via the "travis encrypt" command using the project repo's public key
- secure: "Qm4d8NEDPBtYZCYav46uPEvDCtaRsjLXlkVS+C+WCJAPcwXCGkrr96wEi7RWcq2xD86QCh0XiqaPT+xdUmlohOYIovRhaaBmZ1lwIJ4GsG/ZR6xoFr3DYsZ3o4GyXk2vNXNxEl82AC+Xs6e6gkLOV9XRkBcjpVIvoIXgNlKWeGY="
# GCC 7.4.0 Debug build with GCov for coverage build (Ubuntu Bionic 18.04)
- dist: bionic
env:
- cc=gcc cxx=g++
- GCOV=ON
- COVERALLS=ON
# GCC 7.4.0 Debug build with Valgrind instead of Address Sanitizer (Ubuntu Bionic 18.04)
- dist: bionic
env:
- cc=gcc cxx=g++
- ASAN=OFF
- VALGRIND=ON
# GCC 7.4.0 Release build (Ubuntu Bionic 18.04)
- dist: bionic
env:
- cc=gcc cxx=g++
- BUILD_TYPE=Release
# GCC 7.4.0 Shared Libs (Ubuntu Bionic 18.04)
- dist: bionic
env:
- cc=gcc cxx=g++
- SHARED_LIBS=ON
# GCC 7.4.0 test linking with libsqlite3-dev package (Ubuntu Bionic 18.04)
- dist: bionic
env:
- cc=gcc cxx=g++
- INTERNAL_SQLITE=OFF
# GCC 5.4.0 (Ubuntu Xenial 16.04)
- dist: xenial # Default
env:
- cc=gcc cxx=g++
# GCC 4.8.4 (Ubuntu Trusty 14.04)
- dist: trusty
env:
- cc=gcc cxx=g++
- TESTS=OFF
##########################################################################
# Clang on Linux
##########################################################################
# Clang 7.0.0 (Ubuntu Jammy 22.04)
- dist: jammy
env:
- cc=clang cxx=clang++
# Clang 7.0.0 (Ubuntu Focal 20.04)
- dist: focal
env:
- cc=clang cxx=clang++
# Clang 7.0.0 (Ubuntu Bionic 18.04)
- dist: bionic
env:
- cc=clang cxx=clang++
# Clang 7.0.0 (Ubuntu Xenial 16.04)
- dist: xenial # Default
env:
- cc=clang cxx=clang++
# Clang 5.0.0 (Ubuntu Trusty 14.04)
- dist: trusty
env:
- cc=clang cxx=clang++
- TESTS=OFF
##########################################################################
# Clang on OSX
##########################################################################
# XCode 14.2 - Apple clang 14.0.0 - macOS 12.6
- os: osx
osx_image: xcode14.2
env:
- cc=clang cxx=clang++
# Default XCode - Apple clang 9.1.0 - macOS 10.13
- os: osx
osx_image: xcode9.4 # Default
env:
- cc=clang cxx=clang++
# XCode 8.3 - Applec lang 8.1.0 - macOS 10.12
- os: osx
osx_image: xcode8.3
env:
- cc=clang cxx=clang++
- TESTS=OFF
before_install:
# Coverity: don't use addons.coverity_scan since it run on every job of the build matrix, which waste resources and exhausts quotas
# 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.)
- if [[ -n "$COVERITY_SCAN_PROJECT_NAME" ]] ; then curl -s https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh | bash ; exit 0 ; fi
- if [[ "$INTERNAL_SQLITE" == "OFF" ]]; then sudo apt-get install libsqlite3-dev ; fi
- if [[ "$VALGRIND" == "ON" ]]; then sudo apt-get install valgrind ; fi
- if [[ "$COVERALLS" == "ON" ]]; then pip install --user cpp-coveralls ; fi
# Set the compiler environment variables properly
- export CC=${cc}
- export CXX=${cxx}
# scripts to run before build
before_script:
- mkdir build
- cd build
- cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_SHARED_LIBS=$SHARED_LIBS -DSQLITECPP_INTERNAL_SQLITE=$INTERNAL_SQLITE -DSQLITECPP_USE_ASAN=$ASAN -DSQLITECPP_USE_GCOV=$GCOV -DSQLITECPP_BUILD_EXAMPLES=$TESTS -DSQLITECPP_BUILD_TESTS=$TESTS ..
# build examples, and run tests (ie make & make test)
script:
- cmake --build .
- export ASAN_OPTIONS=verbosity=1:debug=1
- if [[ "$TESTS" == "ON" ]]; then ctest --verbose --output-on-failure ; fi
- if [[ "$VALGRIND" == "ON" ]]; then valgrind --leak-check=full --error-exitcode=1 bin/SQLiteCpp_example1 ; fi
- if [[ "$VALGRIND" == "ON" ]]; then valgrind --leak-check=full --error-exitcode=1 bin/SQLiteCpp_tests ; fi
# generate and publish GCov coveralls results
after_success:
- if [[ "$COVERALLS" == "ON" ]]; then coveralls --root .. -e examples -e googletest -e sqlite3 -e tests -E ".*feature_tests.*" -E ".*CompilerId.*" --gcov-options '\-lp' ; fi