qtui: Set desktop file name
[quassel.git] / .travis.yml
index fe824dd..a997607 100644 (file)
@@ -1,56 +1,90 @@
-os:
-  - osx
-  - linux
-
 sudo: required
-dist: trusty
-
-install: |-
-  if [ "$TRAVIS_OS_NAME" == "osx" ]
-  then
-    brew update
-    brew install ninja qt5
-  fi
-  if [ "$TRAVIS_OS_NAME" == "linux" ]
-  then
-    sudo apt-get -qy install libqt5webkit5-dev qttools5-dev qtscript5-dev
-    sudo apt-get -qy install libdbusmenu-qt-dev libdbusmenu-qt5-dev
-    sudo apt-get -qy install libphonon-dev libphonon4qt5-dev
-    sudo apt-get -qy install libqca2-dev
-    sudo apt-get -qy install qt4-dev-tools qttools5-dev-tools
-    sudo apt-get -qy install libphonon4qt5experimental4 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805096
-  fi
 
-language: cpp
-cache: ccache
+services:
+  - docker
 
-compiler:
-  - gcc
-  - clang
+# Define build matrix for Linux
+os: linux
+language: generic  # No host compilation
 
 env:
-  - QT_VERSION=qt4
-  - QT_VERSION=qt5
+  - DIST=xenial CXX=g++     CMAKE_OPTIONS="-DWITH_KDE=OFF -DWITH_WEBKIT=OFF"
+  - DIST=xenial CXX=clang++ CMAKE_OPTIONS="-DWITH_KDE=OFF -DWITH_WEBKIT=OFF"
+  - DIST=xenial CXX=g++     CMAKE_OPTIONS="-DWITH_KDE=ON  -DWITH_WEBKIT=ON"
+  - DIST=xenial CXX=clang++ CMAKE_OPTIONS="-DWITH_KDE=ON  -DWITH_WEBKIT=ON"
+  - DIST=bionic CXX=g++     CMAKE_OPTIONS="-DWITH_KDE=ON  -DWITH_WEBKIT=ON"
+  - DIST=bionic CXX=clang++ CMAKE_OPTIONS="-DWITH_KDE=ON  -DWITH_WEBENGINE=ON"
+  - DIST=cosmic CXX=g++     CMAKE_OPTIONS="-DWITH_KDE=ON  -DWITH_WEBENGINE=ON"
+  - DIST=cosmic CXX=clang++ CMAKE_OPTIONS="-DWITH_KDE=ON  -DWITH_WEBENGINE=ON"
+
+# Set up cache
+cache:
+  directories:
+    - $TRAVIS_BUILD_DIR/ccache
 
-script: |-
-  mkdir build
-  cd build
-  if [ "$TRAVIS_OS_NAME" == "osx" ]
-  then
-    cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DUSE_QT5=ON -DWANT_CORE=ON -DWANT_QTCLIENT=ON -DWANT_MONO=ON -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5
-    ninja install
-  elif [ "$TRAVIS_OS_NAME" == "linux" ]
-  then
-    if [ "$QT_VERSION" = "qt4" ]; then cmake ..; fi
-    if [ "$QT_VERSION" = "qt5" ]; then cmake -DUSE_QT5=ON ..; fi
-    make
-  fi
+# Prepare
+before_install:
+  - docker pull quassel/quassel-build-env:$DIST
+  - docker images
+  - mkdir build
 
-matrix:
-  exclude:
-    - compiler: clang
-      env: QT_VERSION=qt4
+# Build inside the docker image
+# Source, build and ccache directories are bind-mounted into the container
+script:
+  - |
+    docker run -t -w /build --rm \
+               -v "$(readlink -f .):/src" \
+               -v "$(readlink -f build):/build" \
+               -v "$(readlink -f ccache):/ccache" \
+               -e CCACHE_DIR=/ccache \
+               -e CCACHE_MAXSIZE=1G \
+               -e CXX=$CXX \
+               quassel/quassel-build-env:$DIST \
+               sh -c "cmake /src $CMAKE_OPTIONS \
+                            -GNinja \
+                            -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+                            -DBUILD_TESTING=ON \
+                            -DFATAL_WARNINGS=ON \
+                      && ninja install \
+                      && ccache -s \
+                      && ctest -VV \
+                     "
+
+# Define a separate job for OSX
+jobs:
+  include:
     - os: osx
+      language: cpp
       compiler: clang
-    - os: osx
-      env: QT_VERSION=qt4
+      env:
+      cache:
+        directories:
+          - $HOME/.ccache
+          - $HOME/Library/Caches/Homebrew
+      before_install:
+        - brew update && brew install ccache ninja qca qt5
+      script:
+        - export CCACHE_MAXSIZE=1G
+        - mkdir build && cd build
+        - |
+          PATH=$PATH:/usr/local/opt/qt5/bin
+          DEPLOY=OFF
+          if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]; then
+            DEPLOY=ON
+          fi
+          cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DDEPLOY=$DEPLOY
+          ninja install
+        - ccache -s
+        - ctest -VV
+      deploy:
+        provider: releases
+        api_key: "${GH_TOKEN}"
+        file_glob: true
+        file:
+          - "QuasselClient_MacOSX-x86_64_*.dmg"
+          - "QuasselCore_MacOSX-x86_64_*.dmg"
+          - "QuasselMono_MacOSX-x86_64_*.dmg"
+        skip_cleanup: true
+        on:
+          tags: true
+          condition: "$GH_TOKEN != ''"