-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
85 lines (68 loc) · 3.11 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
# Sources:
# https://gist.github.com/vidavidorra/548ffbcdae99d752da02
# http://www.steveklabnik.com/automatically_update_github_pages_with_travis_example/
#use trusty distro for C++11 and cmake 3+
dist: trusty
sudo: require
#blacklist
branches:
except:
- gh-pages
env:
global:
- GITHUB_REPO: pfcrender
#additional deps
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
#docs
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen
- graphviz
#build
- cmake
#opengl
- libgles2-mesa
#coverage
- lcov
language: C++
compiler:
- gcc
- clang++
os:
- linux
- osx
before_install:
# C++14
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test ; fi
# Qt5.9
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then travis_retry sudo add-apt-repository ppa:beineri/opt-qt592-trusty -y ; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then travis_retry sudo apt-get update -qq ; fi
install:
# C++14
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then travis_retry sudo apt-get install -qq g++-5 ; fi
# g++ should call g++-5
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then travis_retry sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 90 ; fi
#Qt5.9
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then travis_retry travis_wait sudo apt-get install qt59-meta-full ; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then source /opt/qt59/bin/qt59-env.sh ; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then travis_retry brew update ; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then brew install qt5 ; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then export Qt5_DIR=/usr/local/opt/qt/bin; fi
#emulate x server to run the gui on linux - necessary for testing
before_script:
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then export DISPLAY=:99.0 ; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then sh -e /etc/init.d/xvfb start ; fi
- if [[ $TRAVIS_OS_NAME == 'linux' ]] ; then sleep 3 ; fi # give xvfb some time to start
script:
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX != 'g++' ]] ; then cd bin && cmake .. && make && ctest -V ; fi
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]] ; then cd bin && cmake -DCMAKE_BUILD_TYPE=Coverage -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=g++-5 .. && make VERBOSE=1 && ctest -V ; fi
- if [[ $TRAVIS_OS_NAME == 'osx' ]] ; then cd bin && cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/qt .. && make && ctest -V ; fi
#On successful build of master branch regenerate doxygen docs and publish on Github Pages, upload gcov results to coveralls
after_success:
- test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && bash $TRAVIS_BUILD_DIR/doc/deploy-doxygen-to-gh-pages.sh
- if [[ $TRAVIS_OS_NAME == 'linux' && $CXX == 'g++' ]] ; then lcov --gcov-tool /usr/bin/x86_64-linux-gnu-gcov-5 --directory . --capture --output-file coverage.info && lcov --remove coverage.info '*_autogen/*' '/usr/*' --output-file coverage.info && lcov --list coverage.info && bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" ; fi