forked from MrSapps/alive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
116 lines (104 loc) · 6.5 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
sudo: required
dist: trusty
os:
- linux
- osx
osx_image: xcode7
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "d8/9ELIMrdr9hB2ZB5U33hWlFGUMTjK1Ncj7nOLb1hsHS6/U7XyAh5RNl3v90K0iOCvFXokIc1EFmiTZiw/dP15S+MONRs9MgzwHkMlXfdkHtaPswNRYfXavWuhaGXNSSNAlwKxRCobymyVX5goKxsADaAouSY/vQwKVdIVYd1s="
- secure: "Gv879EwhQyTnFmClRfD+YrEF5GuH6gl/EORkUaW27gjcKvjGhW4K6yHNjJ4kiuYybvVVaJ5AY1K8WUnH6AhfECfKJBl5Eb7EZA47o4Z8UkmiyEs296OWyPHIwIWrLWQsXIQ2nb1fwKnd0nzpiyy5DzSxm5pgotv3eU/ipdZUp20="
- secure: "dlvyRvnk4+6XP/b1atadJhvL7QjdV74/3Q48joUmT6EPlBhG7YSKZsbQir+vZInufXJ9dgqm7k4sbLt4pPM4BpspnP7QERzvL5e5qQjJ/9g+aDedtNDOhJXqH9iU+Rf9GHoScsP5XfUgSYSn+GtJomC9FI9BSBLOkJVSnc3ljZc="
matrix:
- COVERAGE=1
- COVERAGE=0
matrix:
exclude:
# Don't build using gcc on mac
# - os: osx
# compiler: gcc
# Don't try to do Coverity or coverage builds on mac
- os: osx
env: COVERITY=1
env: COVERAGE=1
# Don't do cov or coverage on clang
- os: linux
compiler: clang
env: COVERITY=1
env: COVERAGE=1
# Don't build with clang on Linux
# - os: linux
# compiler: clang
compiler:
- gcc
- clang
language: cpp
before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get -qq update; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y cmake; fi
install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get -qq update; fi
#- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get --allow-unauthenticated upgrade; fi
#- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install cmake; fi
# new gcc pulls in new libstdcpp for make_unique in clang
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install gcc-4.9; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install g++-4.9; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" == 0 ]]; then sudo apt-get install valgrind; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-4.9 90; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --config gcc; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo update-alternatives --config g++; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install ruby1.9.1 ruby1.9.1-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install rubygems1.9.1 irb1.9.1 ri1.9.1; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then rvmsudo gem install coveralls-lcov; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo apt-get install lcov; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libgtk-3-dev; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then tar xf lcov_1.11.orig.tar.gz; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" ]]; then sudo make -C lcov-1.11/ install; fi
#- if [ "$TRAVIS_OS_NAME" == "linux" ]; then curl -O http://www.libsdl.org/release/SDL2-2.0.4.tar.gz; fi
#- if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar -xzvf SDL2-2.0.4.tar.gz; fi
#- if [ "$TRAVIS_OS_NAME" == "linux" ]; then (cd SDL2-2.0.4 && ./configure && make && sudo make install); fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev libsdl2-dev; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install sdl2; fi
#- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install cmake; fi
script:
- $CXX --version
- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then mkdir build; fi
- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then cd build; fi
- UseValgrind=OFF
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" == 0 ]]; then UseValgrind=ON; fi
- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then cmake --version; fi
- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then cmake -G"Unix Makefiles" .. -DUseValgrind=$UseValgrind; fi
- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then make -j2; fi
- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then cpack -C Release; fi
- if [[ "${COVERITY_SCAN_BRANCH}" != 1 ]]; then ctest -VV; fi
after_success:
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" == 1 ]]; then lcov --directory . --capture --output-file coverage.info; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" == 1 ]]; then lcov --remove coverage.info '*/3rdParty/*' '/usr/*' --output-file coverage.info; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" == 1 ]]; then lcov --list coverage.info; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "${COVERITY_SCAN_BRANCH}" != 1 && "${COVERAGE}" == 1 ]]; then coveralls-lcov coverage.info; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then fileToUpload=`ls *.dmg`; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then fileToUpload=`ls *.deb`; fi
- hash=`git rev-parse HEAD`
- if [[ "$CXX" == "g++" && "${COVERITY_SCAN_BRANCH}" == 0 && "${COVERAGE}" == 0 ]]; then curl --ftp-create-dirs -T $fileToUpload -u $FTP_USER:$FTP_PASSWORD ftp://mlgthatsme.com/$hash/$fileToUpload; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then fileToUpload=`ls *.tar.gz`; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" == "g++" && "${COVERITY_SCAN_BRANCH}" == 0 && "${COVERAGE}" == 0 ]]; then curl --ftp-create-dirs -T $fileToUpload -u $FTP_USER:$FTP_PASSWORD ftp://mlgthatsme.com/$hash/$fileToUpload; fi
language: cpp
notifications:
irc:
- "irc.esper.net#oddworld"
addons:
coverity_scan:
project:
name: "paulsapps/alive"
description: "Build submitted via Travis CI"
notification_email: github@paulsapps.com
build_command_prepend: "mkdir build; cd build; cmake .."
build_command: "make -j 2"
branch_pattern: coverity_scan