X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=.travis.yml;h=7cb33f36f03949fec49c4da595f648ad2d508a68;hp=3eac5a59bf7473ad8f0fb78d54b48dd25de11331;hb=5df177b26253451046b7255189e646bd36dbab73;hpb=ce26c3770b254362c7bd1e094ba8f8bf22133653 diff --git a/.travis.yml b/.travis.yml index 3eac5a59..7cb33f36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,81 @@ -language: cpp -compiler: - - gcc - - clang +sudo: required +services: + - docker + +# Define build matrix for Linux +os: linux +language: generic # No host compilation + +env: + - DIST=xenial CXX=gcc CMAKE_OPTIONS="-DWITH_KDE=OFF -DWITH_WEBKIT=ON" + - DIST=xenial CXX=gcc CMAKE_OPTIONS="-DWITH_KDE=ON -DWITH_WEBKIT=ON" + - DIST=xenial CXX=clang CMAKE_OPTIONS="-DWITH_KDE=OFF -DWITH_WEBKIT=ON" + - DIST=xenial CXX=clang CMAKE_OPTIONS="-DWITH_KDE=ON -DWITH_WEBKIT=ON" + - DIST=bionic CXX=clang CMAKE_OPTIONS="-DWITH_KDE=OFF -DWITH_WEBENGINE=ON" + - DIST=bionic CXX=clang CMAKE_OPTIONS="-DWITH_KDE=ON -DWITH_WEBENGINE=ON" + +# Set up cache +cache: + directories: + - $TRAVIS_BUILD_DIR/ccache + +# Prepare before_install: - - echo "yes" | sudo add-apt-repository ppa:kalakris/cmake - - sudo apt-get update -qq - - sudo apt-get install cmake + - docker pull quassel/quassel-build-env:$DIST + - docker images + - mkdir build + +# 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 CC=$CXX -e CXX=$CXX \ + quassel/quassel-build-env:$DIST \ + sh -c "cmake -GNinja /src $CMAKE_OPTIONS \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + && ninja \ + && ccache -s \ + " -script: mkdir build && cd build && cmake ../ && make +# Define a separate job for OSX +jobs: + include: + - os: osx + language: cpp + compiler: clang + env: + cache: + ccache: true + directories: + - $HOME/Library/Caches/Homebrew + before_install: + - brew update && brew install ccache ninja qca qt5 + script: + - mkdir build && cd build + - | + PATH=$PATH:/usr/local/opt/qt5/bin + DEPLOY=OFF + if [[ "$TRAVIS_TAG" != "" && "$GH_TOKEN" != "" ]]; then + DEPLOY=ON + fi + cmake -G"Ninja" .. -DCMAKE_BUILD_TYPE=Release -DUSE_CCACHE=OFF -DDEPLOY=$DEPLOY + ninja install + - ccache -s + 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 != ''"