diff --git a/.travis.yml b/.travis.yml index eb7d5605..90ffd3d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,30 @@ notifications: # and an empty 'python' variable in order to prevent that Travis attempts # to install Python. # TODO: Figure out how specific versions of Python 3.x can be used with OS-X + +# When defining the job matrix explicitly, there are Travis environments +# that produce an additional default job. See these Travis issues: +# https://github.com/travis-ci/travis-ci/issues/1228 +# https://github.com/travis-ci/travis-ci/issues/4681 +# https://github.com/travis-ci/travis-ci/issues/9843 +# The public Travis does not seem to have this issue anymore, +# but Travis@IBM does have this issue (as of 9/2018). The workaround for +# this issue is to define variables globally and to exclude this same +# variable value in the matrix definition. Experiments have shown that +# not all variable combinations work. Using a combination of 'language' +# and 'os' set to the default values works. + +# See note about explicit job matrix, above. +language: ruby +os: linux + matrix: + + # See note about explicit job matrix, above. + exclude: + - language: ruby + - os: linux + include: # - os: linux # language: python @@ -105,6 +128,23 @@ matrix: cache: pip before_install: + - env | sort + + # The following statement is a workaround to leave an OS-X job + # when running on Linux. That happens on Travis@IBM which does not + # have OS-X support but still runs os=osx on Linux. + - if [[ "$TRAVIS_OS_NAME" == "osx" && "$_system_type" == "Linux" ]]; then + echo "Exiting from OS-X job running on Linux"; + exit; + fi + + # The following statement is a safety net in case the matrix exclusion + # does not work for some reason. + - if [[ "$TRAVIS_LANGUAGE" == "ruby" ]]; then + echo "Exiting from unwanted default Ruby job"; + exit; + fi + - if [[ "$TRAVIS_BRANCH" == "manual-ci-run" ]]; then export _NEED_REBASE=true; fi