diff --git a/.travis.yml b/.travis.yml index a5ede05..5b97cb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,16 +8,11 @@ matrix: sudo: required dist: trusty env: - matrix: - - SWIFT_VERSION=swift-3.1 - - SWIFT_VERSION=swift-3.0.2 + - SWIFT_VERSIONS=(3.0.2 3.1) env: global: - LC_CTYPE=en_US.UTF-8 - LANG=en_US.UTF-8 - FRAMEWORK_NAME="RandomKit" - - SWIFTENV_INSTALL="https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh" -before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then gem install xcpretty -N; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then eval "$(curl -sL $SWIFTENV_INSTALL)"; fi +install: ./ci/install.sh script: ./ci/travis.sh diff --git a/ci/install.sh b/ci/install.sh new file mode 100755 index 0000000..36ee16d --- /dev/null +++ b/ci/install.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e + +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + export SWIFTENV_ROOT="$HOME/.swiftenv" + git clone https://github.com/kylef/swiftenv.git "$SWIFTENV_ROOT" + export PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH" + + for version in "$SWIFT_VERSIONS"; do + swiftenv install "$version" + done +elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + gem install xcpretty -N +fi diff --git a/ci/travis.sh b/ci/travis.sh index 47986cd..ee3aa89 100755 --- a/ci/travis.sh +++ b/ci/travis.sh @@ -3,7 +3,12 @@ set -e -o pipefail if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - swift test + for version in "$SWIFT_VERSIONS"; do + swiftenv global "$version" + swiftenv version + + swift test + done elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then xcodebuild -version