diff options
-rw-r--r-- | .travis.yml | 4 | ||||
-rwxr-xr-x | tests/travis-macos-setup.sh | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml index b0f533730..238f450cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: - cp .travis.yml /tmp/travis.yml - git pull origin master --strategy=recursive --strategy-option=theirs --no-edit - if ! git diff .travis.yml /tmp/travis.yml ; then echo "Please merge master into test-everything"; exit 1; fi - - '([ $TRAVIS_OS_NAME == linux ] && dpkg -s libaugeas0) || (brew update && brew install augeas && brew upgrade python python3 && brew link python)' + - '[ "$TRAVIS_OS_NAME" != osx ] || tests/travis-macos-setup.sh' before_script: - 'if [ $TRAVIS_OS_NAME = osx ] ; then ulimit -n 1024 ; fi' @@ -121,7 +121,7 @@ matrix: env: TOXENV=py27 os: osx - language: generic - env: TOXENV=py37 + env: TOXENV=py3 os: osx diff --git a/tests/travis-macos-setup.sh b/tests/travis-macos-setup.sh new file mode 100755 index 000000000..bf72f26a5 --- /dev/null +++ b/tests/travis-macos-setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash -e +# +# Set up the test environment for macOS on Travis. + +# Install the given package with brew if it's not already installed. +brew_install() { + if ! brew list "$1" > /dev/null 2>&1; then + brew install "$1" + fi +} + +brew_install augeas +brew_install python +brew_install python3 + +# Ensure we use python from brew. +brew link python |