From 5acb4a93392c613f3a43bbec04b5aae2e849d957 Mon Sep 17 00:00:00 2001 From: mdeniz Date: Fri, 9 Jun 2017 14:41:44 +0200 Subject: [PATCH 1/2] Split in 2 jobs Travis build --- .travis.yml | 9 ++++++--- travis_script.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100755 travis_script.sh diff --git a/.travis.yml b/.travis.yml index 0be912e1..6c83258b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,9 @@ before_script: - mysql -u root -e 'create database osem_test;' - RAILS_ENV=test bundle exec rake db:migrate --trace script: - - 'bundle exec rubocop -Dc .rubocop.yml' - - 'bundle exec haml-lint app/views' - - 'bundle exec rspec --color --format documentation' + - "./travis_script.sh $TEST_SUITE" +env: + - TEST_SUITE=rspec + - TEST_SUITE=linters +matrix: + fast_finish: true diff --git a/travis_script.sh b/travis_script.sh new file mode 100755 index 00000000..77ca2329 --- /dev/null +++ b/travis_script.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# This script runs the test suites for the CI build + +# Be verbose and fail script on the first error +set -xe + +# By default: all test runs +if [ -z $1 ]; then + TEST_SUITE="all" +else + TEST_SUITE="$1" +fi + +case $TEST_SUITE in + linters) + bundle exec rubocop -Dc .rubocop.yml + bundle exec haml-lint app/views + ;; + rspec) + bundle exec rspec --color --format documentation + ;; + *) + bundle exec rubocop -Dc .rubocop.yml + bundle exec haml-lint app/views + bundle exec rspec --color --format documentation + ;; +esac From ebe1ca374da3366e29efe1e63a65d618cdfe9fe5 Mon Sep 17 00:00:00 2001 From: mdeniz Date: Fri, 9 Jun 2017 14:41:51 +0200 Subject: [PATCH 2/2] Fix the Travis failure in the last PR about axlsx dependencies --- Gemfile | 3 ++- Gemfile.lock | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 497c56b1..76c49ce3 100644 --- a/Gemfile +++ b/Gemfile @@ -128,6 +128,7 @@ gem 'country_select' gem 'prawn_rails' # to render XLS spreadsheets +gem 'axlsx', git: 'https://github.com/randym/axlsx.git' gem 'axlsx_rails' # as error catcher @@ -178,7 +179,7 @@ gem 'cloudinary' # for setting app configuration in the environment gem 'dotenv-rails' -# For countable.js +# For countable.js gem "countable-rails", "~> 0.0.1" # Both are not in a group as we use it also for rake data:demo diff --git a/Gemfile.lock b/Gemfile.lock index 90ae82f0..e1c8218f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,13 @@ +GIT + remote: https://github.com/randym/axlsx.git + revision: c8ac844572b25fda358cc01d2104720c4c42f450 + specs: + axlsx (2.1.0.pre) + htmlentities (~> 4.3.4) + mimemagic (~> 0.3) + nokogiri (>= 1.6.6) + rubyzip (>= 1.2.1) + GEM remote: https://rubygems.org/ remote: https://rails-assets.org/ @@ -65,10 +75,6 @@ GEM awesome_nested_set (3.0.0.rc.5) activerecord (>= 4.0.0, < 5) aws_cf_signer (0.1.3) - axlsx (2.0.1) - htmlentities (~> 4.3.1) - nokogiri (>= 1.4.1) - rubyzip (~> 1.2.1) axlsx_rails (0.2.0) axlsx (>= 2.0.1) rails (>= 3.1) @@ -262,6 +268,7 @@ GEM mime-types (>= 1.16, < 3) method_source (0.8.2) mime-types (2.99.1) + mimemagic (0.3.2) mina (0.3.8) open4 (~> 1.3.4) rake @@ -551,6 +558,7 @@ DEPENDENCIES ahoy_matey autoprefixer-rails awesome_nested_set (~> 3.0.0.rc.5) + axlsx! axlsx_rails bootstrap-sass (~> 3.3.4.1) bootstrap-switch-rails (~> 3.0.0)