forked from mongodb/mongo-cxx-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
100 lines (72 loc) · 2.99 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
dist: trusty
sudo: required
language: cpp
compiler:
- gcc
- clang
env:
global:
- MONGO_REPO="[ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu"
- REPO_TYPE="trusty/mongodb-enterprise/3.4 multiverse"
- SOURCES_LOC="/etc/apt/sources.list.d/mongodb-enterprise.list"
- KEY_SERVER="hkp://keyserver.ubuntu.com:80"
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/trusty/ llvm-toolchain-trusty-3.6 main'
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
# MongoDB Enterprise Edition, latest stable version
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
- echo "deb ${MONGO_REPO} ${REPO_TYPE}" | sudo tee ${SOURCES_LOC}
# Update all the repositories
- sudo apt-get update -qq
# Mongo C Driver
- git clone 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
- sudo apt-get install -qq cmake
# Blow away any prior mongodb state so we don't have prior db state that
# that doesn't have the right featureCompatibilityVersion
- sudo dpkg --purge mongodb-org
- sudo rm -rf /var/lib/mongodb
# Install MongoDB Enterprise
- sudo apt-get install mongodb-enterprise-server
# Install Mongo C Driver
- pushd mongo-c-driver
- git checkout master
- cmake -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
- make
- sudo make install
- popd
# Start up the server. We don't care to terminate it, since we are in an ephemeral VM.
- sudo service mongod start
before_script:
- $CC --version
- $CXX --version
# Build the driver and the tests
- cd build
- cmake -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
# TODO(CXX-1548) Remove filter once Travis runs mongo >= 3.6.
- ./src/mongocxx/test/test_driver '~[min36]'
# 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