From bbc29c0dfb1603c929b01c93692ebecff7d63e28 Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Thu, 15 Sep 2016 23:07:39 -0700 Subject: [PATCH] chore: Fix Travis builds using appraisal gem This commit fixes the Travis builds by using different gemfiles for different versions of Ruby and some gem dependencies (notably rack 1.x and 2.x). These gemfiles are managed by the `appraisal` gem. It also switches our build matrix from testing with `jruby-head` to testing with `jruby-9.0.5.0`, since `jruby-head` has some issues with `bundler` not being installed. In addition to these changes, I have also enabled Travis's caching feature for Bundler. Hopefully this should speed up our test runs once the caches are primed. --- .travis.yml | 64 ++++++++++++++++++++++++++--------------- Appraisals | 7 +++++ Gemfile | 7 +++++ gemfiles/rack_1.gemfile | 15 ++++++++++ gemfiles/rack_2.gemfile | 15 ++++++++++ omniauth-saml.gemspec | 1 + 6 files changed, 86 insertions(+), 23 deletions(-) create mode 100644 Appraisals create mode 100644 gemfiles/rack_1.gemfile create mode 100644 gemfiles/rack_2.gemfile diff --git a/.travis.yml b/.travis.yml index 9676a1a..ec2b927 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,31 +1,49 @@ env: global: - JRUBY_OPTS="$JRUBY_OPTS --debug" + +sudo: false language: ruby -script: bundle exec rspec -before_install: gem update bundler +cache: bundler + +before_install: + - gem update bundler + +before_script: + - bundle update + +script: + - bundle exec rspec + +rvm: + - 1.9.3 + - jruby-19mode + - 2.0.0 + - 2.1.10 + - 2.2.2 + - 2.3.1 + - jruby-9.0.5.0 + - ruby-head + +gemfile: + - gemfiles/rack_1.gemfile + - gemfiles/rack_2.gemfile + matrix: - include: - - rvm: 1.9.3 - gemfile: Gemfile - - rvm: 2.0.0 - gemfile: Gemfile - - rvm: 2.1 - gemfile: Gemfile - - rvm: 2.2 - gemfile: Gemfile - - rvm: 2.3.0 - gemfile: Gemfile - - rvm: jruby-19mode - gemfile: Gemfile - - rvm: jruby-head - gemfile: Gemfile - - rvm: rbx-2 - gemfile: Gemfile - - rvm: ruby-head - gemfile: Gemfile allow_failures: - - rvm: jruby-head - rvm: ruby-head + fast_finish: true -sudo: false + + exclude: + - rvm: 1.9.3 + gemfile: gemfiles/rack_2.gemfile + + - rvm: jruby-19mode + gemfile: gemfiles/rack_2.gemfile + + - rvm: 2.0.0 + gemfile: gemfiles/rack_2.gemfile + + - rvm: 2.1.10 + gemfile: gemfiles/rack_2.gemfile diff --git a/Appraisals b/Appraisals new file mode 100644 index 0000000..7208cd4 --- /dev/null +++ b/Appraisals @@ -0,0 +1,7 @@ +appraise 'rack-1' do + gem 'rack', '~> 1.x' +end + +appraise 'rack-2' do + gem 'rack', '~> 2.x' +end diff --git a/Gemfile b/Gemfile index 0d40ba9..3cb5947 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,14 @@ source 'https://rubygems.org' group :test do gem 'coveralls', '~> 0.8', '>= 0.8.13', require: false + + # Lock coveralls dependencies to lower versions to work with older rubies + gem 'json', '~> 1.8' + gem 'tins', '~> 1.6.0' + gem 'mime-types', '< 3' end +gem 'appraisal' + gemspec diff --git a/gemfiles/rack_1.gemfile b/gemfiles/rack_1.gemfile new file mode 100644 index 0000000..ddf3a7e --- /dev/null +++ b/gemfiles/rack_1.gemfile @@ -0,0 +1,15 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "appraisal" +gem "rack", "~> 1.x" + +group :test do + gem "coveralls", "~> 0.8", ">= 0.8.13", :require => false + gem "json", "~> 1.8" + gem "tins", "~> 1.6.0" + gem "mime-types", "< 3" +end + +gemspec :path => "../" diff --git a/gemfiles/rack_2.gemfile b/gemfiles/rack_2.gemfile new file mode 100644 index 0000000..169a459 --- /dev/null +++ b/gemfiles/rack_2.gemfile @@ -0,0 +1,15 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "appraisal" +gem "rack", "~> 2.x" + +group :test do + gem "coveralls", "~> 0.8", ">= 0.8.13", :require => false + gem "json", "~> 1.8" + gem "tins", "~> 1.6.0" + gem "mime-types", "< 3" +end + +gemspec :path => "../" diff --git a/omniauth-saml.gemspec b/omniauth-saml.gemspec index e016be9..dce6f02 100644 --- a/omniauth-saml.gemspec +++ b/omniauth-saml.gemspec @@ -14,6 +14,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'omniauth', '~> 1.3' gem.add_runtime_dependency 'ruby-saml', '~> 1.3' + gem.add_development_dependency 'rake', '>= 10', '< 12' gem.add_development_dependency 'rspec', '~>3.4' gem.add_development_dependency 'simplecov', '~> 0.11' gem.add_development_dependency 'rack-test', '~> 0.6', '>= 0.6.3'