forked from Ericsson/CodeCompass
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
238 lines (224 loc) · 6 KB
/
.travis.yml
File metadata and controls
238 lines (224 loc) · 6 KB
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
os: linux
sudo: require
language: generic
services:
- postgresql
.apt_xenial: &apt_xenial
update: true
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-xenial-7
packages:
# Boost
- libboost-all-dev
# LLVM/clang
- llvm-7
- llvm-7-dev
- clang-7
- libclang-7-dev
# Java
- default-jdk
# ODB
- odb
- libodb-dev
# SQLite
- libodb-sqlite-dev
- libsqlite3-dev
# PostgreSQL
- libodb-pgsql-dev
- postgresql-server-dev-9.5
# Parser
- libmagic-dev
- libgit2-dev
- ctags
# Service
- libgraphviz-dev
- nodejs-legacy
- npm
# GTest
- libgtest-dev
# Thrift
- libssl-dev
# Thrift (compile)
- byacc
- flex
.install_bionic: &install_bionic
>
sudo apt-get install -y
libboost-all-dev
llvm-7 llvm-7-dev clang-7 libclang-7-dev
default-jdk
gcc-7-plugin-dev
libsqlite3-dev
postgresql-server-dev-10
libmagic-dev libgit2-dev ctags
libgraphviz-dev npm
libgtest-dev
libssl1.0-dev
byacc flex
.install_odb: &install_odb
|
if [ ! -f "$HOME/build2_install/bin/bpkg" ]; then
mkdir /tmp/build2src
cd /tmp/build2src
curl -sSfO https://download.build2.org/0.12.0/build2-install-0.12.0.sh
sh build2-install-0.12.0.sh --yes --trust yes "$HOME/build2_install/"
fi
export PATH=$PATH:$HOME/build2_install/bin/
if [ ! -f "$HOME/odb_install/bin/odb" ]; then
mkdir /tmp/odb_build
cd /tmp/odb_build
bpkg create --quiet --jobs $(nproc) cc \
config.cxx=g++ config.cc.coptions=-O3 \
config.bin.rpath="$HOME/odb_install/lib" config.install.root="$HOME/odb_install" \
config.install.sudo=sudo
bpkg add https://pkg.cppget.org/1/beta --trust-yes
bpkg fetch --trust-yes
bpkg build odb --yes
bpkg build libodb --yes
bpkg build libodb-sqlite --yes
bpkg build libodb-pgsql --yes
bpkg install --all --recursive
fi
.install_thrift: &install_thrift
|
if [ ! -f "$HOME/thrift_install/bin/thrift" ]; then
cd $HOME
wget -O thrift-0.13.0.tar.gz "http://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=thrift/0.13.0/thrift-0.13.0.tar.gz"
tar -xvf ./thrift-0.13.0.tar.gz
cd thrift-0.13.0
./configure --prefix=$HOME/thrift_install --without-python \
--enable-libtool-lock --enable-tutorial=no --enable-tests=no \
--with-libevent --with-zlib --without-nodejs --without-lua \
--without-ruby --without-csharp --without-erlang --without-perl \
--without-php --without-php_extension --without-dart \
--without-haskell --without-go --without-rs --without-haxe \
--without-dotnetcore --without-d --without-qt4 --without-qt5 \
--without-java
make install
fi
.install_gtest_xenial: &install_gtest_xenial
|
if [ ! -f "$HOME/gtest_install/lib/libgtest.a" ]; then
cd $HOME
mkdir gtest
cp -R /usr/src/gtest/* ./gtest
cd gtest
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/gtest_install
make
mkdir -p $HOME/gtest_install/lib
cp libgtest.a libgtest_main.a $HOME/gtest_install/lib/
fi
.install_gtest_bionic: &install_gtest_bionic
|
if [ ! -f "$HOME/gtest_install/lib/libgtest.a" ]; then
cd $HOME
mkdir gtest
cp -R /usr/src/googletest/* ./gtest
cd gtest
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/gtest_install
make install
fi
before_script:
# Default locations and versions
- which cmake g++ clang llvm-config javac
- cmake --version
- g++ --version
- clang --version
- llvm-config --version --has-rtti
- javac -version
# LLVM/Clang test from package install
- /usr/bin/clang-7 --version
- /usr/bin/llvm-config-7 --version --has-rtti
# ODB
- export CMAKE_PREFIX_PATH=$HOME/odb_install:$CMAKE_PREFIX_PATH
- export PATH=$HOME/odb_install/bin:$PATH
- odb --version
# Thrift
- export CMAKE_PREFIX_PATH=$HOME/thrift_install:$CMAKE_PREFIX_PATH
- export PATH=$HOME/thrift_install/bin:$PATH
- thrift --version
# GTest
- export GTEST_ROOT=$HOME/gtest_install
.build_postgres: &build_postgres
- cd $TRAVIS_BUILD_DIR
- mkdir build_pgsql && cd build_pgsql
- >
cmake ..
-DDATABASE=pgsql
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/install_pgsql
-DTEST_DB="pgsql:host=localhost;port=5432;user=postgres;password=;database=cc_test"
-DLLVM_DIR=/usr/lib/llvm-7/cmake
-DClang_DIR:PATH=/usr/lib/cmake/clang-7
- make install
- make test ARGS=-V
.build_sqlite: &build_sqlite
- cd $TRAVIS_BUILD_DIR
- mkdir build_sqlite && cd build_sqlite
- >
cmake ..
-DDATABASE=sqlite
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/install_sqlite
-DTEST_DB="sqlite:database=$HOME/cc_test.sqlite"
-DLLVM_DIR=/usr/lib/llvm-7/cmake
-DClang_DIR:PATH=/usr/lib/cmake/clang-7
- make install
- make test ARGS=-V
jobs:
include:
- name: "Xenial PostgreSQL build"
dist: xenial
addons:
apt:
<<: *apt_xenial
postgresql: "9.5"
install:
- *install_thrift
- *install_gtest_xenial
script:
*build_postgres
- name: "Xenial SQLite build"
dist: xenial
addons:
apt:
<<: *apt_xenial
postgresql: "9.5"
install:
- *install_thrift
- *install_gtest_xenial
script:
*build_sqlite
- name: "Bionic PostgreSQL build"
dist: bionic
addons:
postgresql: "10"
install:
- sudo apt-get update -y
- *install_bionic
- *install_odb
- *install_thrift
- *install_gtest_bionic
script:
*build_postgres
- name: "Bionic SQLite build"
dist: bionic
addons:
postgresql: "10"
install:
- sudo apt-get update -y
- *install_bionic
- *install_odb
- *install_thrift
- *install_gtest_bionic
script:
*build_sqlite
cache:
directories:
- $HOME/thrift_install
- $HOME/gtest_install
- $HOME/build2_install
- $HOME/odb_install