forked from Ericsson/CodeCompass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
198 lines (185 loc) · 4.57 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
os: linux
sudo: require
language: cpp
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
odb libodb-dev
libodb-sqlite-dev libsqlite3-dev
libodb-pgsql-dev postgresql-server-dev-10
libmagic-dev libgit2-dev ctags
libgraphviz-dev npm
libgtest-dev
libssl1.0-dev
byacc flex
.install_thrift: &install_thrift
|
if [ ! -f "$HOME/thrift_install/bin/thrift" ]; then
cd $HOME
wget -O thrift-0.12.0.tar.gz "http://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=thrift/0.12.0/thrift-0.12.0.tar.gz"
tar -xvf ./thrift-0.12.0.tar.gz
cd thrift-0.12.0
./configure --prefix=$HOME/thrift_install --without-python --without-php --without-ruby --without-nodejs --without-go --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
# 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_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_thrift
- *install_gtest_bionic
script:
*build_sqlite
cache:
directories:
- $HOME/thrift_install
- $HOME/gtest_install