aboutsummaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 18611379b43d396e0a15066aeaeffeffac07abbc (plain)
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Kodi's travis-ci.org integration file

# TODO:
# integrate with slack
# make it perfect... or not ;-r


language: cpp

# Define the build matrix
#
# Travis defaults to building on Ubuntu Precise when building on Linux. We need Trusty in order to get up
# to date versions of cmake and g++.
#
os: linux
dist: trusty
sudo: required
compiler:
  - gcc
  - clang

env:
  - BUILD=Kodi TOOLS=Autotools
  - BUILD=Kodi TOOLS=CMake
  - ADDONS=adsp
  - ADDONS=audiodecoder
  - ADDONS=audioencoder
  - ADDONS=pvr
  - ADDONS=screensaver
  - ADDONS=visualization

matrix:
  fast_finish: true
  allow_failures:
    - env: ADDONS=adsp
    - env: ADDONS=audiodecoder
    - env: ADDONS=audioencoder
    - env: ADDONS=pvr
    - env: ADDONS=screensaver
    - env: ADDONS=visualization

# Prepare system
#
# Prepare the system to install prerequisites or dependencies
#
before_install:
# Prune non-root Python from PATH. Solves https://github.com/travis-ci/travis-ci/issues/4948
# see: https://github.com/travis-ci/travis-ci/issues/5326
  - export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")

# Linux
#
# Install team-xbmc/xbmc-ppa-build-depends for some dependencies and ppa:wsnipex/vaapi for libda-dev 1.6.0.
# Stupid libda-dev 1.3.0 does not work on Trusty.

  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" ]]; then
      sudo add-apt-repository -y ppa:team-xbmc/xbmc-ppa-build-depends &&
      sudo add-apt-repository -y ppa:wsnipex/vaapi &&
      sudo add-apt-repository -y ppa:george-edison55/cmake-3.x &&
      sudo apt-get update -qq;
    fi

# Install dependencies
#
# Install any prerequisites or dependencies necessary to run our builds
#
install:

# Linux dependencies
#
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" ]]; then
      sudo apt-get install -qq automake autopoint build-essential cmake curl default-jre gawk gdb gdc
      gettext git-core gperf libasound2-dev libass-dev libbz2-dev libcap-dev libcdio-dev libcrossguid-dev libcurl3
      libcurl4-openssl-dev libdbus-1-dev libfontconfig-dev libegl1-mesa-dev libfreetype6-dev libfribidi-dev libgif-dev
      libiso9660-dev libjpeg-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmodplug-dev libmysqlclient-dev libnfs-dev
      libpcre3-dev libplist-dev libpng-dev libpulse-dev libsdl2-dev libsmbclient-dev libsqlite3-dev libssh-dev
      libssl-dev libtag1-dev libtinyxml-dev libtool libudev-dev libusb-dev libva-dev libvdpau-dev
      libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev libyajl-dev mesa-utils
      nasm pmount python-dev python-imaging python-sqlite swig unzip uuid-dev yasm zip zlib1g-dev;
    fi

# Prepare builds
#
before_script:

# Linux
#
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" ]]; then
      ulimit -c unlimited -S;
      if [[ "$TOOLS" == "Autotools" ]]; then
        cd $TRAVIS_BUILD_DIR &&
        ./bootstrap;
      elif [[ "$TOOLS" == "CMake" ]]; then
        mkdir $TRAVIS_BUILD_DIR/build &&
        cd $TRAVIS_BUILD_DIR/build;
      fi
    fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" && "$CXX" == "g++" ]]; then
      if [[ "$TOOLS" == "Autotools" ]]; then
        ./configure --enable-debug;
      elif [[ "$TOOLS" == "CMake" ]]; then
        cmake -DCMAKE_BUILD_TYPE=Debug ../project/cmake;
      fi
    fi
  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" && "$CXX" == "clang++" ]]; then
      if [[ "$TOOLS" == "Autotools" ]]; then
        CXXFLAGS="-Qunused-arguments" ./configure;
      elif [[ "$TOOLS" == "CMake" ]]; then
        cmake -DCMAKE_CXX_FLAGS="-Qunused-arguments" ../project/cmake;
      fi
    fi
  - if [[ "$BUILD" != "Kodi" ]] && [[ "$ADDONS" == "adsp" || "$ADDONS" == "audiodecoder" || "$ADDONS" == "audioencoder" ||
          "$ADDONS" == "pvr" || "$ADDONS" == "screensaver" || "$ADDONS" == "visualization" ]]; then
      cd $TRAVIS_BUILD_DIR/project/cmake/addons &&
      mkdir -p build &&
      cd build/ &&
      cmake ../bootstrap -DCMAKE_BUILD_TYPE=Debug &&
      make -j3;
    fi

# Actually build
#
script:
  - if [[ "$BUILD" == "Kodi" ]]; then
      if [[ "$TOOLS" == "Autotools" ]]; then
        make -j3 &&
        make testsuite &&
        ./kodi-test;
      elif [[ "$TOOLS" == "CMake" ]]; then
        make -j3 &&
        make check;
      fi
    fi
  - if [[ "$BUILD" != "Kodi" ]] && [[ "$ADDONS" == "adsp" || "$ADDONS" == "audiodecoder" || "$ADDONS" == "audioencoder" ||
          "$ADDONS" == "pvr" || "$ADDONS" == "screensaver" || "$ADDONS" == "visualization" ]]; then
      cd $TRAVIS_BUILD_DIR/ &&
      mkdir -p build &&
      cmake -DADDONS_TO_BUILD="$ADDONS".* -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../addons $TRAVIS_BUILD_DIR/project/cmake/addons &&
      make -j3;
    fi

after_failure:
  - COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1)
  - if [[ -f "$COREFILE" ]]; then
      gdb -c "$COREFILE" kodi-test -ex "thread apply all bt" -ex "set pagination 0" -batch;
    fi

# Disable annoying emails
#
notifications:
  email: false