Skip to content

Commit

Permalink
Travis: Consistent .travis.yml between external and IBM Travis
Browse files Browse the repository at this point in the history
Details:

* We define the job matrix explicitly with include statements, so
  that we have granular control over which combinations will run.
  Also, an explicit job matrix is required for OS-X support on the
  public Travis.

  When defining the job matrix explicitly, there are Travis environments
  that produce an additional default job. See these Travis issues:
    travis-ci/travis-ci#1228
    travis-ci/travis-ci#4681
    travis-ci/travis-ci#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 (language=ruby, os=linux) works.

  As an extra safety net against running with language=ruby, there is
  a statement that exits the job when the language is ruby.

* OS-X is not supported on Travis@IBM, so this change adds a statement
  that exits the job when os=osx runs on Linux.

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
  • Loading branch information
andy-maier committed Sep 3, 2018
1 parent 471733e commit 7217cec
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7217cec

Please sign in to comment.