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