travis: Add jobs for building against KDE Frameworks
[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=gcc   CMAKE_OPTIONS="-DWITH_KDE=OFF -DWITH_WEBKIT=ON"
12   - DIST=xenial CXX=gcc   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
16 # Set up cache
17 cache:
18   directories:
19     - $TRAVIS_BUILD_DIR/ccache
20
21 # Prepare
22 before_install:
23   - docker pull quassel/quassel-build-env:$DIST
24   - docker images
25   - mkdir build
26
27 # Build inside the docker image
28 # Source, build and ccache directories are bind-mounted into the container
29 script:
30   - |
31     docker run -t -w /build --rm \
32                -v "$(readlink -f .):/src" \
33                -v "$(readlink -f build):/build" \
34                -v "$(readlink -f ccache):/ccache" \
35                -e CCACHE_DIR=/ccache \
36                -e CC=$CXX -e CXX=$CXX \
37                quassel/quassel-build-env:$DIST \
38                sh -c "cmake -GNinja /src $CMAKE_OPTIONS \
39                             -DCMAKE_BUILD_TYPE=RelWithDebInfo \
40                       && ninja \
41                       && ccache -s \
42                      "
43
44 # Define a separate job for OSX
45 jobs:
46   include:
47     - os: osx
48       language: cpp
49       compiler: clang
50       env:
51       cache:
52         ccache: true
53         directories:
54           - $HOME/Library/Caches/Homebrew
55       before_install:
56         - brew update && brew install ccache ninja qca qt5
57       script:
58         - mkdir build && cd build
59         - |
60           PATH=$PATH:/usr/local/opt/qt5/bin
61           DEPLOY=OFF
62           if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]; then
63             DEPLOY=ON
64           fi
65           cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DUSE_CCACHE=OFF -DDEPLOY=$DEPLOY
66           ninja install
67         - ccache -s
68       deploy:
69         provider: releases
70         api_key: "${GH_TOKEN}"
71         file_glob: true
72         file:
73           - "QuasselClient_MacOSX-x86_64_*.dmg"
74           - "QuasselCore_MacOSX-x86_64_*.dmg"
75           - "QuasselMono_MacOSX-x86_64_*.dmg"
76         skip_cleanup: true
77         on:
78           tags: true
79           condition: "$GH_TOKEN != ''"