Skip to content
Permalink
Browse files

.travis.yml: refactor before_install on OSX. Don't fail if a tool isn…

…'t available, since homebrew is unreliable and linux isn't
  • Loading branch information...
austin987 committed Oct 26, 2019
1 parent 1f8436a commit f965bffb390023ccad28a351fc57b2a41da81e42
Showing with 18 additions and 8 deletions.
  1. +18 −8 .travis.yml
@@ -21,8 +21,6 @@ addons:
# for checkbashisms
- devscripts

# Note: if statements cannot go across multiple lines. Combine into one, or move to a shell script!

# Ubuntu notes:
# * ShellCheck is already installed in TravisCI
# * bashate is not available on Trusty and we need to install it manually
@@ -52,12 +50,24 @@ addons:
# If the script fails, install pip and use it to install bashate
before_install:
- time sh ./misc/travis-install-bashate-deb.sh || time sh ./misc/travis-install-bashate-pip.sh
# "brew update" (or auto-update when installing) takes long time
# checkbashisms and shellcheck can be installed without this
# So installing with "HOMEBREW_NO_AUTO_UPDATE=1" considerably reduces
# job time on macOS
# If it fails retry with auto-update
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] ; then time env HOMEBREW_NO_AUTO_UPDATE=1 brew install checkbashisms shellcheck || time brew install checkbashisms shellcheck ; fi

# "brew update" (or auto-update when installing) takes a long time,
# but checkbashisms and shellcheck can be installed without this
# So try installing with "HOMEBREW_NO_AUTO_UPDATE=1", which considerably reduces job time on macOS
# If it fails retry each individually with auto-update enabled
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]] && time env HOMEBREW_NO_AUTO_UPDATE=1 brew install checkbashisms shellcheck; then
# everything worked, nothing more to do:
:
else
# Note: ./tests/shell-checks will skip the tests on OSX if these aren't available (but not on Linux)
# so don't fail if one isn't available. Still good to try to get both Linux/OSX, since they may have different versions.
for tool in checkbashisms shellcheck; do
if [[ ! -x "$(command -v \"$tool\")" ]]; then
time brew install "$tool" || true
fi
done
fi
# Note if testing on a branch, you can replace this with your desired command, e.g.,:
# script: time sh ./src/winetricks -q comctl32

0 comments on commit f965bff

Please sign in to comment.
You can’t perform that action at this time.