forked from mongodb-labs/mangrove
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
85 lines (65 loc) · 2.42 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
language: cpp
sudo: false
branches:
only:
- master
compiler:
- gcc
- clang
env:
global:
- CMAKE_VERSION="cmake-3.2.3-Linux-x86_64"
- CMAKE_BINARY="${CMAKE_VERSION}/bin/cmake"
- CDRIVER_VERSION="1.7.0"
matrix:
- CONFIG=Release
- CONFIG=Debug
addons:
apt:
sources:
# Add the modern toolchain repositories (llvm repo depends on ubunut-toolchain-r + gcc)
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.8
# Add the MongoDB 3.2 repository
- mongodb-3.2-precise
packages:
- mongodb-org-server
- g++-6
- clang-3.8
install:
# GCC
- if [ "$CXX" = "g++" ]; then export CXX="g++-6"; export CC="gcc-6"; export NO_ERROR_ON_MAYBE_UNINITIALIZED="-Wno-error=maybe-uninitialized"; fi
# Clang
- if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.8"; export CC="clang-3.8"; fi
# Don't Wno-error-maybe-uninitialized if we're in a Debug build
- if [ "$CONFIG" == "Debug"]; then export NO_ERROR_ON_MAYBE_UNINITIALIZED=""; fi
# Prepare pkg-config path
- export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/deps/lib/pkgconfig/
# Install dependencies
- curl -O https://cmake.org/files/v3.2/${CMAKE_VERSION}.tar.gz
- tar -zxf ${CMAKE_VERSION}.tar.gz -C build
- bash travis-install-deps.sh
before_script:
- $CC --version
- $CXX --version
# Build Mangrove and its tests
- export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/install/lib/pkgconfig
- cd build
- export CC_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers ${NO_ERROR_ON_MAYBE_UNINITIALIZED}"
- ${CMAKE_BINARY} -DCMAKE_BUILD_TYPE=$CONFIG -DCMAKE_MODULE_PATH=$HOME/deps/mongo-cxx-driver/cmake -Dlibbsoncxx_DIR=$HOME/deps/lib/cmake/libbsoncxx-3.1.3 -Dlibmongocxx_DIR=$HOME/deps/lib/cmake/libmongocxx-3.1.3 -DCMAKE_INSTALL_PREFIX=$HOME/install -DCMAKE_C_FLAGS="${CC_FLAGS}" -DCMAKE_CXX_FLAGS="${CC_FLAGS}" ..
script:
- make format-lint
- make -j$(grep -c ^processor /proc/cpuinfo) all
# Run boson tests with catch
- ./src/boson/test/test_boson
# Run boson tests with catch
- ./src/mangrove/test/test_mangrove
# Install headers and libs for the examples
- make install
# Make the examples
- make examples
# Run the examples
- make run-examples
cache:
directories:
- $HOME/deps