From e658e76bfc612887516b6ca2afeeb6f0a7cce029 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 16 Nov 2020 10:46:14 +0200 Subject: [PATCH] Cache for Homebrew. [skip appveyor] --- .travis.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.travis.yml b/.travis.yml index e91a80ce8..b4f2eb0eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,12 +30,25 @@ jobs: - DEPLOY=true - LEGACY=false osx_image: xcode11 + cache: + directories: + - $HOME/Library/Caches/Homebrew + - /usr/local/Homebrew - os: osx compiler: clang env: - DEPLOY=true - LEGACY=true osx_image: xcode9.2 + cache: + directories: + - $HOME/Library/Caches/Homebrew + - /usr/local/Homebrew +before_cache: + - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi +# Credit https://discourse.brew.sh/t/best-practice-for-homebrew-on-travis-brew-update-is-5min-to-build-time/5215/9 +# Cache only .git files under "/usr/local/Homebrew" so "brew update" does not take 5min every build + - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then find /usr/local/Homebrew \! -regex ".+\.git.+" -delete; fi before_install: - | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then @@ -63,6 +76,7 @@ before_install: else unset SSL_CERT_FILE; brew tap-new ${USER}/local-qt; + brew update > /dev/null; brew extract --version 5.11 qt ${USER}/local-qt; brew install ${USER}/local-qt/qt@5.11; fi