travisci: Cache Homebrew files

This commit is contained in:
Philipp Wolfer
2019-08-07 13:45:17 +02:00
parent 63c697b1cc
commit 76ee7cfacd

View File

@@ -7,8 +7,11 @@ python:
- '3.6'
- '3.5'
cache:
- apt
- pip
apt: true
pip: true
directories:
- $HOME/Library/Caches/Homebrew
- /usr/local/Homebrew
env:
global:
- PIP_INSTALL="pip3 install"
@@ -51,6 +54,13 @@ matrix:
- PYTHON_VERSION=3.7.4
- INSTALL_DEPS="$PIP_INSTALL -r requirements-macos.txt"
fast_finish: true
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 sudo apt-get update -qq && sudo apt-get
install -qq $LIBDISCID qt5-default; fi
@@ -60,18 +70,23 @@ before_install:
- "$INSTALL_DEPS"
- "$INSTALL_TEST_TOOLS"
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash scripts/package-osx.sh; fi
script:
- py.test -v --cov=picard --cov-report xml:coverage.xml
- isort --check-only --diff --quiet $(git ls-tree -r --name-only $(git rev-parse HEAD) | grep "\\.py$")
after_success:
- if [ ! -z "${CODACY_PROJECT_TOKEN}" ]; then $CODACY; python-codacy-coverage -r coverage.xml;
fi
notifications:
irc: chat.freenode.net#metabrainz
branches:
only:
- master
- /\d\.[0-9x](\.[0-9x])?/
deploy:
provider: releases
api_key: