forked from bazelregistry/mongo-cxx-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
96 lines (70 loc) · 2.8 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
dist: trusty
sudo: required
language: cpp
compiler:
- gcc
- clang
env:
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 -
# 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
# Install and start mongod.
- sudo apt-get install -qq libsnmp30
- curl --retry 8 http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-ubuntu1404-latest.tgz --max-time 300 --output mongodb-binaries.tgz
- tar -xf mongodb-binaries.tgz
- rm mongodb-binaries.tgz
- mv mongodb* mongodb
- ./mongodb/bin/mongod --version
- mkdir ./mongodb/data
- ./mongodb/bin/mongod --dbpath ./mongodb/data --logpath ./mongodb/logs --fork --setParameter enableTestCommands=1
# Install Mongo C Driver
- pushd mongo-c-driver
- git checkout master
- sudo pip install GitPython
- python build/calc_release_version.py > VERSION_CURRENT
- python build/calc_release_version.py -p > VERSION_RELEASED
- cmake -DENABLE_TESTS=OFF -DENABLE_EXAMPLES=OFF -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
- make
- sudo make install
- popd
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 --coverage" ..
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
after_success:
# Uploading report to CodeCov
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"