From 1565309146916323a9d7f36acdd07829d07e2f1f Mon Sep 17 00:00:00 2001 From: tooomm Date: Fri, 7 Jul 2017 16:17:18 +0200 Subject: [PATCH] enable caching for ci (#2799) * enable cache * caching on mac * fix ci caching on mac * fix * add mac cache * added homebrew cache and pretty print yaml (+ structural ordering) * cleanup * fix ccache on mac * testing workaround https://github.com/travis-ci/travis-ci/issues/7456#issuecomment-296505058 * try xcode7.3 instead of workaround * cache timout value more time for cache to upload --- .travis.yml | 44 +++++++++++++++++++++++++++++------------- travis-compile.sh | 1 + travis-dependencies.sh | 2 +- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff2d0566..624be861 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ +sudo: required # forces legacy build infrastructure + language: cpp -sudo: required + matrix: fast_finish: true include: @@ -10,21 +12,28 @@ matrix: dist: trusty env: BUILDTYPE=Release DIST=trusty - os: osx - osx_image: xcode6.4 + osx_image: xcode7.3 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: xcode6.4 + osx_image: xcode7.3 env: BUILDTYPE=Release -script: "./travis-compile.sh" + cache: + ccache: true + timeout: 360 # 6min timeout for cache uploading instead default 3 + directories: + - $HOME/Library/Caches/Homebrew # cache Homebrew ressources + +cache: ccache + install: "./travis-dependencies.sh" -cache: apt -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/d94969c3b01b22cbdcb7 - on_success: change - on_failure: change - on_start: never + +script: "./travis-compile.sh" + deploy: provider: releases api_key: @@ -37,4 +46,13 @@ deploy: on: tags: true repo: Cockatrice/Cockatrice - condition: $BUILDTYPE = Release \ No newline at end of file + condition: $BUILDTYPE = Release + +notifications: + webhooks: + urls: + - https://webhooks.gitter.im/e/d94969c3b01b22cbdcb7 + on_success: change + on_failure: change + on_start: never + diff --git a/travis-compile.sh b/travis-compile.sh index fd4c925e..8d36577f 100755 --- a/travis-compile.sh +++ b/travis-compile.sh @@ -8,6 +8,7 @@ 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*/)" fi if [[ $TRAVIS_OS_NAME == "linux" ]]; then diff --git a/travis-dependencies.sh b/travis-dependencies.sh index e607ecd7..d59c0b18 100755 --- a/travis-dependencies.sh +++ b/travis-dependencies.sh @@ -1,7 +1,7 @@ #!/bin/bash if [[ $TRAVIS_OS_NAME == "osx" ]] ; then - brew update > /dev/null + brew install ccache # enable caching on mac (PATH only set in travis-compile.sh) brew install --force qt@5.7 brew install protobuf else