From 14a0c53fc1d79530b9d6c579599b254fba38cc0b Mon Sep 17 00:00:00 2001 From: tooomm Date: Sun, 21 Jan 2018 23:07:25 +0100 Subject: [PATCH] travis update (osx + linux) (#3041) --- {.travis => .ci}/travis-compile.sh | 14 ++--- {.travis => .ci}/travis-dependencies.sh | 3 ++ .travis.yml | 72 ++++++++++--------------- 3 files changed, 40 insertions(+), 49 deletions(-) rename {.travis => .ci}/travis-compile.sh (67%) mode change 100755 => 100644 rename {.travis => .ci}/travis-dependencies.sh (56%) mode change 100755 => 100644 diff --git a/.travis/travis-compile.sh b/.ci/travis-compile.sh old mode 100755 new mode 100644 similarity index 67% rename from .travis/travis-compile.sh rename to .ci/travis-compile.sh index 8d36577f..e09bc0f3 --- a/.travis/travis-compile.sh +++ b/.ci/travis-compile.sh @@ -7,6 +7,7 @@ set -e mkdir -p build cd build prefix="" + if [[ $TRAVIS_OS_NAME == "osx" ]]; then export PATH="/usr/local/opt/ccache/libexec:$PATH" prefix="-DCMAKE_PREFIX_PATH=$(echo /usr/local/opt/qt*/)" @@ -17,10 +18,11 @@ if [[ $TRAVIS_OS_NAME == "linux" ]]; then fi if [[ $BUILDTYPE == "Debug" ]]; then - cmake .. -DWITH_SERVER=1 -DTEST=1 -DCMAKE_BUILD_TYPE=$BUILDTYPE $prefix - make -j2 - make test -else - cmake .. -DWITH_SERVER=1 -DCMAKE_BUILD_TYPE=$BUILDTYPE $prefix - make package -j2 + cmake .. -DWITH_SERVER=1 -DCMAKE_BUILD_TYPE=$BUILDTYPE $prefix -DTEST=1 + make -j2 + make test +fi +if [[ $BUILDTYPE == "Release" ]]; then + cmake .. -DWITH_SERVER=1 -DCMAKE_BUILD_TYPE=$BUILDTYPE $prefix + make package -j2 fi diff --git a/.travis/travis-dependencies.sh b/.ci/travis-dependencies.sh old mode 100755 new mode 100644 similarity index 56% rename from .travis/travis-dependencies.sh rename to .ci/travis-dependencies.sh index e00068e4..39526199 --- a/.travis/travis-dependencies.sh +++ b/.ci/travis-dependencies.sh @@ -4,4 +4,7 @@ if [[ $TRAVIS_OS_NAME == "osx" ]] ; then brew install ccache # enable caching on mac (PATH only set in travis-compile.sh) brew install --force qt@5.7 brew install protobuf +fi +if [[ $TRAVIS_OS_NAME == "linux" ]] ; then + echo Skipping... packages are installed with the Travis apt addon for sudo disabled container builds fi \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 164e32df..0aebaf63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,64 +1,48 @@ language: cpp +cache: ccache + + matrix: fast_finish: true include: - os: linux dist: trusty + group: stable env: BUILDTYPE=Debug - addons: - apt: - packages: - - bc - - cmake - - libprotobuf-dev - - protobuf-compiler - - qt5-default - - qttools5-dev - - qttools5-dev-tools - - qtmultimedia5-dev - - libqt5multimedia5-plugins - - libqt5svg5-dev - - libqt5sql5-mysql - os: linux dist: trusty + group: stable env: BUILDTYPE=Release - addons: - apt: - packages: - - bc - - cmake - - libprotobuf-dev - - protobuf-compiler - - qt5-default - - qttools5-dev - - qttools5-dev-tools - - qtmultimedia5-dev - - libqt5multimedia5-plugins - - libqt5svg5-dev - - libqt5sql5-mysql + if: branch = master AND NOT type = pull_request - os: osx - osx_image: xcode7.3 + osx_image: xcode8 env: BUILDTYPE=Debug - cache: - ccache: true - timeout: 360 # 6min timeout for cache uploading instead default 3 - directories: - - $HOME/Library/Caches/Homebrew # cache Homebrew ressources - os: osx - osx_image: xcode7.3 + osx_image: xcode8 env: BUILDTYPE=Release - cache: - ccache: true - timeout: 360 # 6min timeout for cache uploading instead default 3 - directories: - - $HOME/Library/Caches/Homebrew # cache Homebrew ressources + if: branch = master AND NOT type = pull_request -cache: ccache +#install dependencies for container-based "linux" builds +addons: + apt: + packages: + - bc + - cmake + - libprotobuf-dev + - protobuf-compiler + - qt5-default + - qttools5-dev + - qttools5-dev-tools + - qtmultimedia5-dev + - libqt5multimedia5-plugins + - libqt5svg5-dev + - libqt5sql5-mysql -before_install: bash ./.travis/travis-dependencies.sh + +before_install: bash ./.ci/travis-dependencies.sh -script: bash ./.travis/travis-compile.sh +script: bash ./.ci/travis-compile.sh # Builds for pull requests skip the deployment step altogether @@ -103,6 +87,8 @@ notifications: on_success: change on_failure: change on_start: never + on_cancel: change + on_error: change # official validator for ".travis.yml" config file: https://yaml.travis-ci.org