From 9daf1d495ef1a2246c55c2cddc634cbbff962d05 Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Wed, 5 Apr 2017 02:24:09 +0200 Subject: [PATCH] Update .travis.yml to build all gemfiles --- .travis.yml | 11 ++++++++++- test/scripts/prepare-travis.sh | 12 ------------ test/scripts/travis.sh | 7 +++---- 3 files changed, 13 insertions(+), 17 deletions(-) delete mode 100755 test/scripts/prepare-travis.sh diff --git a/.travis.yml b/.travis.yml index 61a0fc0..0769f80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,15 @@ rvm: - 2.3.3 - 2.2.5 - 2.1 +gemfile: + - Gemfile + - test/gemfiles/rails4.Gemfile + - test/gemfiles/no-rails.Gemfile + +matrix: + exclude: + - rvm: 2.1 + gemfile: Gemfile sudo: false cache: @@ -15,7 +24,7 @@ branches: - 'master' - 'develop' -before_install: test/scripts/prepare-travis.sh +before_install: gem install bundler bundler_args: "--deployment --without development --jobs=3 --retry=3" script: test/scripts/travis.sh diff --git a/test/scripts/prepare-travis.sh b/test/scripts/prepare-travis.sh deleted file mode 100755 index 61449b7..0000000 --- a/test/scripts/prepare-travis.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -x - -gem install bundler - -if [[ ${TRAVIS_RUBY_VERSION} == "2.1" ]]; then - # use rails 4 for ruby 2.1, because rails 5 needs ruby >= 2.2.2 - echo "gem 'rails', '4.2.7.1'" >> Gemfile - bundle install --without development --jobs=3 --retry=3 - bundle update rails -fi diff --git a/test/scripts/travis.sh b/test/scripts/travis.sh index 8768367..2697001 100755 --- a/test/scripts/travis.sh +++ b/test/scripts/travis.sh @@ -2,12 +2,11 @@ set -x -if [[ ${TRAVIS_RUBY_VERSION} == "2.1" ]]; then - # ruby 2.1 - export NO_COVERAGE="true" # No coverage for rails 4, because controller specs are disabled +if [[ ${BUNDLE_GEMFILE} =~ .*test/gemfiles/.*.Gemfile ]]; then + # No coverage for other gemfiles, because some specs are disabled + export NO_COVERAGE="true" bundle exec rake --trace else - # ruby >= 2.2 bundle exec rake --trace test_exit_code=$? bundle exec codeclimate-test-reporter