• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1language: cpp
2
3dist: trusty
4sudo: true
5
6env:
7  global:
8    secure: FNZOWYO89qsT9kQKngrYbpnqCTMCSCSQ2rnZ3l17KHctOfS554TTDS+dfxPYz2XHm6azYDVcyBSs2gWJ6TmXZZZqEfr3X4VV4ooAa9PoeIkvVlT654zjZwxeXPYXrHFXZh/ImLUGWjsxRaUHYOv5SzyNGcZv07dtLKVd0ykhbH4=
9
10matrix:
11  include:
12
13  - env: BUILD_TYPE=Debug ASAN=Off RUN_TEST=On EXCEPTIONS=On
14    os: osx
15    osx_image: xcode8
16
17  - env: BUILD_TYPE=Debug ASAN=Off LLVM_VERSION=3.8.0 RUN_TEST=On EXCEPTIONS=On
18    os: linux
19    compiler: clang
20
21  - env: BUILD_TYPE=Release ASAN=Off GCC_VERSION=4.9 RUN_TEST=On EXCEPTIONS=On
22    os: linux
23    compiler: gcc
24    addons:
25      apt:
26        packages:
27        - g++-4.9
28        sources:
29        - ubuntu-toolchain-r-test
30
31  - env: BUILD_TYPE=Release ASAN=Off GCC_VERSION=7 RUN_TEST=On EXCEPTIONS=On
32    os: linux
33    compiler: gcc
34    addons: &gcc7
35      apt:
36        packages:
37          - g++-7
38        sources:
39          - ubuntu-toolchain-r-test
40
41  - env: BUILD_TYPE=Debug ASAN=Off GCC_VERSION=8 RUN_TEST=On EXCEPTIONS=Off
42    os: linux
43    compiler: gcc
44    addons: &gcc8
45      apt:
46        packages:
47          - g++-8
48        sources:
49          - ubuntu-toolchain-r-test
50
51  - env: BUILD_TYPE=Release ASAN=Off GCC_VERSION=8 RUN_TEST=On EXCEPTIONS=On
52    os: linux
53    compiler: gcc
54    addons: &gcc8
55      apt:
56        packages:
57          - g++-8
58        sources:
59          - ubuntu-toolchain-r-test
60
61  - env: BUILD_TYPE=Debug ASAN=Off LLVM_VERSION=3.8.0 RUN_TEST=Off EXCEPTIONS=On PROJECT=doc PUBLISH_DOCS=On DOXYGEN_VERSION=1.8.11
62    os: linux
63    compiler: clang
64    addons:
65      apt:
66        packages:
67        - graphviz
68        sources:
69        - ubuntu-toolchain-r-test
70
71cache:
72  directories:
73    - ${TRAVIS_BUILD_DIR}/deps/llvm-3.8.0
74    - ${TRAVIS_BUILD_DIR}/deps/cmake-3.5.2
75    - ${TRAVIS_BUILD_DIR}/deps/doxygen-1.8.11
76
77install:
78  ############################################################################
79  # All the dependencies are installed in ${TRAVIS_BUILD_DIR}/deps/
80  ############################################################################
81  - DEPS_DIR="${TRAVIS_BUILD_DIR}/deps"
82  - mkdir -p ${DEPS_DIR} && cd ${DEPS_DIR}
83
84  ############################################################################
85  # Install Clang, libc++ and libc++abi
86  ############################################################################
87  - |
88    if [[ "${LLVM_VERSION}" != "" ]]; then
89      LLVM_DIR=${DEPS_DIR}/llvm-${LLVM_VERSION}
90      if [[ -z "$(ls -A ${LLVM_DIR})" ]]; then
91        LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz"
92        LIBCXX_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxx-${LLVM_VERSION}.src.tar.xz"
93        LIBCXXABI_URL="http://llvm.org/releases/${LLVM_VERSION}/libcxxabi-${LLVM_VERSION}.src.tar.xz"
94        CLANG_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
95        mkdir -p ${LLVM_DIR} ${LLVM_DIR}/build ${LLVM_DIR}/projects/libcxx ${LLVM_DIR}/projects/libcxxabi ${LLVM_DIR}/clang
96        travis_retry wget --quiet -O - ${LLVM_URL}      | tar --strip-components=1 -xJ -C ${LLVM_DIR}
97        travis_retry wget --quiet -O - ${LIBCXX_URL}    | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxx
98        travis_retry wget --quiet -O - ${LIBCXXABI_URL} | tar --strip-components=1 -xJ -C ${LLVM_DIR}/projects/libcxxabi
99        travis_retry wget --quiet -O - ${CLANG_URL}     | tar --strip-components=1 -xJ -C ${LLVM_DIR}/clang
100        (cd ${LLVM_DIR}/build && cmake .. -DCMAKE_INSTALL_PREFIX=${LLVM_DIR}/install -DCMAKE_CXX_COMPILER=clang++)
101        (cd ${LLVM_DIR}/build/projects/libcxx && make install -j2)
102        (cd ${LLVM_DIR}/build/projects/libcxxabi && make install -j2)
103      fi
104      export CXXFLAGS="-nostdinc++ -isystem ${LLVM_DIR}/install/include/c++/v1"
105      export LDFLAGS="-L ${LLVM_DIR}/install/lib -l c++ -l c++abi"
106      export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LLVM_DIR}/install/lib"
107      export PATH="${LLVM_DIR}/clang/bin:${PATH}"
108      $LLVM_DIR/clang/bin/clang++ --version
109    fi
110
111  ############################################################################
112  # Use gcc
113  ############################################################################
114  - |
115    if [ -n "$GCC_VERSION" ]; then
116      export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}";
117      g++-${GCC_VERSION} --version
118    fi
119
120  - $CXX --version
121
122  ############################################################################
123  # Install a recent Doxygen
124  ############################################################################
125  - |
126    if [ -n "$DOXYGEN_VERSION" ]; then
127      DOXYGEN_DIR=${DEPS_DIR}/doxygen-${DOXYGEN_VERSION}
128      if [[ -z "$(ls -A ${DOXYGEN_DIR})" ]]; then
129        DOXYGEN_URL="https://downloads.sourceforge.net/doxygen/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz"
130        mkdir -p ${DOXYGEN_DIR} && travis_retry wget --quiet -O - ${DOXYGEN_URL} | tar --strip-components=1 -xz -C ${DOXYGEN_DIR}
131      fi
132      export PATH=${DOXYGEN_DIR}/bin:${PATH}
133      doxygen --version
134    fi
135
136  ############################################################################
137  # Install a recent CMake (unless already installed on OS X)
138  ############################################################################
139  - |
140    if [ -z "$CMAKE_VERSION" ]; then
141      CMAKE_VERSION=3.5.2;
142    fi;
143    if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
144      CMAKE_DIR=${DEPS_DIR}/cmake-${CMAKE_VERSION}
145      if [[ -z "$(ls -A ${CMAKE_DIR})" ]]; then
146        CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
147        mkdir -p ${CMAKE_DIR} && travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR}
148      fi
149      export PATH=${CMAKE_DIR}/bin:${PATH}
150    else
151      if ! brew ls --version cmake &>/dev/null; then brew install cmake; fi
152    fi
153    cmake --version
154
155before_script:
156  - |
157    if [ -z "$BUILD_TYPE" ]; then
158      BUILD_TYPE=Release;
159    fi;
160    if [ -z "$EXCEPTIONS" ]; then
161      EXCEPTIONS=On;
162    fi;
163    if [[ "${ASAN}" == "On" ]]; then
164      export CXXFLAGS="${CXXFLAGS} -fsanitize=address,undefined,integer -fno-omit-frame-pointer -fno-sanitize=unsigned-integer-overflow";
165    fi;
166    if [ -n "$LLVM_VERSION" ]; then
167      export CXXFLAGS="${CXXFLAGS} -D__extern_always_inline=inline";
168    fi;
169
170  ############################################################################
171  # generate build
172  ############################################################################
173  - cd ${TRAVIS_BUILD_DIR}
174  - cmake . -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DRX_USE_EXCEPTIONS=${EXCEPTIONS}
175
176script:
177  ############################################################################
178  # Run build
179  ############################################################################
180  - make VERBOSE=1 $PROJECT
181
182  ############################################################################
183  # Test build
184  ############################################################################
185  - cd build/test/
186  - if [[ "${RUN_TEST}" == "On" ]]; then ctest -V; fi
187  - cd ../../
188
189after_success:
190  ############################################################################
191  # Publish documentation
192  ############################################################################
193  - |
194    if [[ "${PUBLISH_DOCS}" == "On" ]]; then
195      sh projects/scripts/travis-doxygen.sh;
196    fi;
197
198branches:
199  only:
200  - master
201
202notifications:
203  email:
204    recipients:
205      - kirk.shoop@microsoft.com
206    on_success: always
207    on_failure: always
208  slack: reactivex:eq4FFCchRIzufO2ZmpuuiJ9E
209  webhooks:
210    urls:
211      - https://webhooks.gitter.im/e/fcf05f21f5d4102e12e7
212deploy:
213  - provider: releases
214    api_key:
215      secure: sMyo0U4WxZ0kOlQ9SzKfeuU2/5y0Ngt8A0B0N6bb0TcGIyLhQv2q216Q+T0rkQKc04WnLY0Vr1/q9LonAA46nGq7zAiWcC3TY0zVUKRmKWrotQb/QqW1tvVEARKwG7CO+HCcGT3XCeM69XA/L7WiXRskTxS1+5Vy46/tVZBKofg=
216    file: ''
217    on:
218      tags: true
219      repo: Reactive-Extensions/RxCpp
220