common: Provide helper for getting member function traits
[quassel.git] / .travis.yml
1 sudo: required
2
3 services:
4   - docker
5
6 # Define build matrix for Linux
7 os: linux
8 language: generic  # No host compilation
9
10 env:
11   - DIST=xenial CXX=g++     CMAKE_OPTIONS="-DWITH_KDE=OFF -DWITH_WEBKIT=ON"
12   - DIST=xenial CXX=g++     CMAKE_OPTIONS="-DWITH_KDE=ON  -DWITH_WEBKIT=ON"
13   - DIST=xenial CXX=clang++ CMAKE_OPTIONS="-DWITH_KDE=OFF -DWITH_WEBKIT=ON"
14   - DIST=xenial CXX=clang++ CMAKE_OPTIONS="-DWITH_KDE=ON  -DWITH_WEBKIT=ON"
15   - DIST=bionic CXX=clang++ CMAKE_OPTIONS="-DWITH_KDE=OFF -DWITH_WEBENGINE=ON"
16   - DIST=bionic CXX=clang++ CMAKE_OPTIONS="-DWITH_KDE=ON  -DWITH_WEBENGINE=ON"
17
18 # Set up cache
19 cache:
20   directories:
21     - $TRAVIS_BUILD_DIR/ccache
22
23 # Prepare
24 before_install:
25   - docker pull quassel/quassel-build-env:$DIST
26   - docker images
27   - mkdir build
28
29 # Build inside the docker image
30 # Source, build and ccache directories are bind-mounted into the container
31 script:
32   - |
33     docker run -t -w /build --rm \
34                -v "$(readlink -f .):/src" \
35                -v "$(readlink -f build):/build" \
36                -v "$(readlink -f ccache):/ccache" \
37                -e CCACHE_DIR=/ccache \
38                -e CXX=$CXX \
39                quassel/quassel-build-env:$DIST \
40                sh -c "cmake /src $CMAKE_OPTIONS \
41                             -GNinja \
42                             -DCMAKE_BUILD_TYPE=RelWithDebInfo \
43                       && ninja install \
44                       && ccache -s \
45                      "
46
47 # Define a separate job for OSX
48 jobs:
49   include:
50     - os: osx
51       language: cpp
52       compiler: clang
53       env:
54       cache:
55         directories:
56           - $HOME/.ccache
57           - $HOME/Library/Caches/Homebrew
58       before_install:
59         - brew update && brew install ccache ninja qca qt5
60       script:
61         - mkdir build && cd build
62         - |
63           PATH=$PATH:/usr/local/opt/qt5/bin
64           DEPLOY=OFF
65           if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]; then
66             DEPLOY=ON
67           fi
68           cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DDEPLOY=$DEPLOY
69           ninja install
70         - ccache -s
71       deploy:
72         provider: releases
73         api_key: "${GH_TOKEN}"
74         file_glob: true
75         file:
76           - "QuasselClient_MacOSX-x86_64_*.dmg"
77           - "QuasselCore_MacOSX-x86_64_*.dmg"
78           - "QuasselMono_MacOSX-x86_64_*.dmg"
79         skip_cleanup: true
80         on:
81           tags: true
82           condition: "$GH_TOKEN != ''"