From 44879600d045d03737099e87e3e555a43bba861d Mon Sep 17 00:00:00 2001 From: Colby Swandale Date: Mon, 5 Nov 2018 21:14:05 +1100 Subject: [PATCH] run coveralls only when COVERALLS env var is present This is to prevent multiple travis-ci jobs running coveralls and results in the coveralls posting multiple reports per PR --- .travis.yml | 6 ++++++ test/helper.rb | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3662217f4..9677c0988 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,12 @@ rvm: - ruby-head - jruby-9.1.16.0 - jruby-head + +matrix: + include: + - rvm: 2.5.3 + env: COVERALLS=yes + before_script: - unset JRUBY_OPTS - unset _JAVA_OPTIONS diff --git a/test/helper.rb b/test/helper.rb index 29f81c1f6..7d0989a38 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -2,9 +2,11 @@ $:.unshift File.expand_path("../../lib", __FILE__) begin - gem "coveralls" - require "coveralls" - Coveralls.wear! + if ENV['COVERALLS'] + gem "coveralls" + require "coveralls" + Coveralls.wear! + end rescue Gem::LoadError end