forked from usgs/neic-glass3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
97 lines (90 loc) · 3.28 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
# travis file for c++, does not include doxygen.
language: c++
sudo: required
# add modern c++ and gtest
addons:
apt:
packages:
- g++-5
- gcc-5
- uuid-dev
# - openssl
# - liblz4
# - libsasl2
# - librt
# - libdl
# - libpthread
# - libssl-dev
- libgtest-dev
- lcov
- cppcheck
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
- unzip
sources:
- ubuntu-toolchain-r-test
install:
# All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
- DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
- mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
# Install a recent CMake (unless already installed on OS X)
- |
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
if [[ -z "$(ls -A ${DEPS_DIR}/cmake/bin)" ]]; then
CMAKE_URL="https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.tar.gz"
mkdir -p cmake && travis_retry wget --no-check-certificate --quiet -O - "${CMAKE_URL}" | tar --strip-components=1 -xz -C cmake
fi
export PATH="${DEPS_DIR}/cmake/bin:${PATH}"
else
if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi
fi
# set compilers
- export CXX="g++-5"
- export CC="gcc-5"
- export LD_LIBRARY_PATH=/usr/local/lib64/
# Build gtest
- cd ${DEPS_DIR}
- mkdir gtest && cd gtest
- export GTEST_ROOT=$(pwd)
- cp -r /usr/src/gtest/* ./
- cmake -D CMAKE_INSTALL_PREFIX:PATH=./ ./
- make
# Build rdkafka
# - cd ${DEPS_DIR}
# - unzip ${TRAVIS_BUILD_DIR}/lib/librdkafka.zip
# - cd librdkafka
# - ./configure
# - make
# - sudo make install
before_script:
- uname -a
- printenv
- g++-5 --version 2>&1 | grep g++-5
script:
# C++ build, tests, and coverage
- cd ${TRAVIS_BUILD_DIR}
- mkdir build
- mkdir dist
- cd build
# build
# - cmake -DBUILD_GLASS-APP=1 -DBUILD_GEN-TRAVELTMES-APP=1 -DBUILD_GLASS-BROKER-APP=1 -DGIT_CLONE_PUBLIC=1 -DRUN_TESTS=1 -DSUPPORT_COVERAGE=1 -DRUN_COVERAGE=1 -DRUN_CPPCHECK=1 -DRUN_CPPLINT=1 -DGENERATE_DOCUMENTATION=1 -DCMAKE_INSTALL_PREFIX=../dist -DRAPIDJSON_PATH=../lib/rapidjson -DLIBRDKAFKA_C_LIB=/usr/local/lib/librdkafka.a -DLIBRDKAFKA_CPP_LIB=/usr/local/lib/librdkafka++.a -DLIBRDKAFKA_PATH=/usr/local/include/librdkafka -DCPPLINT_PATH=../lib/cpplint/cpplint.py -DCPPCHECK_PATH=/usr/bin/cppcheck .. && make
- cmake -DBUILD_GLASS-APP=1 -DGIT_CLONE_PUBLIC=1 -DRUN_TESTS=1 -DSUPPORT_COVERAGE=1 -DRUN_COVERAGE=1 -DRUN_CPPCHECK=1 -DRUN_CPPLINT=1 -DGENERATE_DOCUMENTATION=1 -DCMAKE_INSTALL_PREFIX=../dist -DRAPIDJSON_PATH=../lib/rapidjson -DCPPLINT_PATH=../lib/cpplint/cpplint.py -DCPPCHECK_PATH=/usr/bin/cppcheck .. && make
# copy documentation index.md to doxygen documentation directory
- cd ${TRAVIS_BUILD_DIR}
- cp -r ${TRAVIS_BUILD_DIR}/doc/* ${TRAVIS_BUILD_DIR}/dist/doc
deploy:
# Deploying doxygen documentation to github pages
provider: pages
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
target_branch: gh-pages
keep-history: true
local_dir: ${TRAVIS_BUILD_DIR}/dist/doc
on:
branch: master
after_success:
# Uploading coverage report to CodeCov
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"