This repository has been archived by the owner on Oct 20, 2022. It is now read-only.
forked from mongodb/mongo-cxx-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
93 lines (68 loc) · 3 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
language: cpp
compiler:
- gcc
- clang
env:
global:
- MONGO_REPO="http://repo.mongodb.com/apt/ubuntu"
- REPO_TYPE="precise/mongodb-enterprise/stable multiverse"
- SOURCES_LOC="/etc/apt/sources.list.d/mongodb-enterprise.list"
- KEY_SERVER="hkp://keyserver.ubuntu.com:80"
- CMAKE_VERSION="cmake-3.2.3-Linux-x86_64"
- CMAKE_BINARY="${CMAKE_VERSION}/bin/cmake"
matrix:
- CONFIG=Release
- CONFIG=Debug
# Setup required repositories before installation
before_install:
# Add the modern toolchain repositories (llvm repo depends on ubunut-toolchain-r + gcc)
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- sudo add-apt-repository -y 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main'
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
# Get the latest CMake
- curl -O https://cmake.org/files/v3.2/${CMAKE_VERSION}.tar.gz
# MongoDB Enterprise Edition, latest stable version
- sudo apt-key adv --keyserver ${KEY_SERVER} --recv 7F0CEB10
- sudo apt-key adv --keyserver ${KEY_SERVER} --recv D68FA50FEA312927
- echo "deb ${MONGO_REPO} ${REPO_TYPE}" | sudo tee ${SOURCES_LOC}
# CMake
- sudo add-apt-repository --yes ppa:kalakris/cmake
# Update all the repositories
- sudo apt-get update -qq
# Mongo C Driver
# TODO switch master (branch for current 1.3 dev) to r1.3 when released
- git clone -b '1.3.4' --single-branch https://github.com/mongodb/mongo-c-driver.git
install:
# GCC
- if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.9; export CXX="g++-4.9"; export CC="gcc-4.9"; fi
# Clang
- if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated -qq clang-3.6; export CXX="clang++-3.6"; export CC="clang-3.6"; fi
# CMake
- tar -zxvf ${CMAKE_VERSION}.tar.gz -C build
# Install MongoDB Enterprise
- sudo apt-get install mongodb-enterprise-server
# Install CMake (Versions lower than 2.8.8 do not support object libraries)
- sudo apt-get install cmake
# Install Mongo C Driver
- pushd mongo-c-driver; ./autogen.sh --enable-tests=no --enable-examples=no --with-libbson=bundled; make; sudo make install; popd;
before_script:
- $CC --version
- $CXX --version
# Build the driver and the tests
- cd build
- ${CMAKE_BINARY} -DCMAKE_BUILD_TYPE=$CONFIG -DCMAKE_C_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers" ..
script:
- make format-lint
- make all
# Run bsoncxx tests with catch
- ./src/bsoncxx/test/test_bson
# Run mongocxx tests with catch
- ./src/mongocxx/test/test_driver
# Run mongocxx instance tests with catch
- ./src/mongocxx/test/test_instance
# Install headers and libs for the examples
- make install
# Make the examples
- make examples
# Run the examples
- make run-examples