-before_install:
- - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- - sudo add-apt-repository -y ppa:kalakris/cmake
- - sudo apt-add-repository -y ppa:beineri/opt-qt521
- - sudo apt-get -qq update
+sudo: required
-install:
- - sudo apt-get install -q gcc-4.7 g++-4.7
- - if [ "$CXX" = "clang" ]; then sudo apt-get install -q clang-3.4; fi
- - sudo apt-get install -q cmake
- - sudo apt-get install -q qt52base qt52webkit qt52tools qt52script
- - if [ "$CXX" = "g++" ]; then export CXX="g++-4.7" CC="gcc-4.7"; fi
+services:
+ - docker
-language: cpp
+# Define build matrix for Linux
+os: linux
+dist: bionic
+language: generic # No host compilation
-compiler:
- - gcc
- - clang
+env:
+ - 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"
-env:
- - QT_VERSION=qt4
- - QT_VERSION=qt5
+# Set up cache
+cache:
+ directories:
+ - $TRAVIS_BUILD_DIR/ccache
-script:
+# Prepare
+before_install:
+ - docker pull quassel/quassel-build-env:$DIST
+ - docker images
- mkdir build
- - cd build
- - if [ "$QT_VERSION" = "qt4" ]; then cmake ..; fi
- - if [ "$QT_VERSION" = "qt5" ]; then source /opt/qt52/bin/qt52-env.sh && cmake -DUSE_QT5=ON ..; fi
- - make
\ No newline at end of file
+
+# 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
+ 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 != ''"