From 017f6586d746684e55b31cb8fe9e5d99d11ee927 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Sun, 6 Nov 2016 14:49:54 -0800 Subject: [PATCH] Have both Linux and macOS tests on Travis. The Swift tests will not work on Linux, because they depend on Xcode, so we need a separate macOS run for them. --- .travis.yml | 17 +++++------------ travis/before_install-common.sh | 7 +++++++ travis/before_install-linux.sh | 17 +++++++++++++++++ travis/before_install-macos.sh | 7 +++++++ 4 files changed, 36 insertions(+), 12 deletions(-) create mode 100755 travis/before_install-common.sh create mode 100755 travis/before_install-linux.sh create mode 100755 travis/before_install-macos.sh diff --git a/.travis.yml b/.travis.yml index 5a8318d00..e4a983c3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,8 @@ sudo: true language: java +os: + - linux + - osx script: - mvn -Dparallel=methods -DthreadCount=4 install @@ -8,18 +11,8 @@ jdk: - oraclejdk8 before_install: - - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF - - sudo add-apt-repository ppa:fkrull/deadsnakes -y - - sudo add-apt-repository ppa:rwky/nodejs -y - - sudo apt-get update -qq - - sudo apt-get install -qq python3.5 - - sudo apt-get install -qq nodejs - - echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/3.12.1 main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list - - sudo apt-get install -qq mono-complete - - eval "$(sudo gimme 1.7.3)" - - go version ; go env - - python --version - - python3 --version + - if [[ $TRAVIS_OS_NAME == osx ]]; then ./travis/before_install-macos.sh; fi + - if [[ $TRAVIS_OS_NAME == linux ]]; then ./travis/before_install-linux.sh; fi env: - CXX=g++-5 diff --git a/travis/before_install-common.sh b/travis/before_install-common.sh new file mode 100755 index 000000000..3f6a4ce1e --- /dev/null +++ b/travis/before_install-common.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -euo pipefail + +( go version ; go env ) || true +python --version +python3 --version diff --git a/travis/before_install-linux.sh b/travis/before_install-linux.sh new file mode 100755 index 000000000..ba7a56541 --- /dev/null +++ b/travis/before_install-linux.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euo pipefail + +thisdir=$(dirname $(readlink -f "$0")) + +sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +sudo add-apt-repository ppa:fkrull/deadsnakes -y +sudo add-apt-repository ppa:rwky/nodejs -y +sudo apt-get update -qq +sudo apt-get install -qq python3.5 +sudo apt-get install -qq nodejs +echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/3.12.1 main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list +sudo apt-get install -qq mono-complete +eval "$(sudo gimme 1.7.3)" + +"$thisdir/before_install-common.sh" diff --git a/travis/before_install-macos.sh b/travis/before_install-macos.sh new file mode 100755 index 000000000..a0c3cd57e --- /dev/null +++ b/travis/before_install-macos.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -euo pipefail + +thisdir=$(dirname $(readlink -f "$0")) + +"$thisdir/before_install-common.sh"