Skip to content

Commit

Permalink
Use coveralls for each job
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDaugherty committed Nov 4, 2020
1 parent caa2cc9 commit d3e6b4e
Show file tree
Hide file tree
Showing 22 changed files with 63 additions and 32 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,21 @@ jobs:
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile

- name: Report to Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.github_token }}
flag-name: test-${{ matrix.ruby }}-${{ matrix.gemfile }}
parallel: true


finish:
needs: test
runs-on: ubuntu-latest
steps:

- name: Report completion to Coveralls
uses: coverallsapp/github-action@v1
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
3 changes: 2 additions & 1 deletion gemfiles/pry010.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'
gem "binding_of_caller"
gem "pry", "~> 0.10.0"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/pry011.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'
gem "pry", "~> 0.11.0pre"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/pry09.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'
gem "pry", "~> 0.9.12"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rack.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source "https://rubygems.org"

gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rack_boc.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
gem 'rack', RUBY_VERSION < '2.2.2' ? '~> 1.6' : '~> 2.0'
gem "binding_of_caller"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails42.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem "rails", "~> 4.2.0"
gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails42_boc.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
gem "binding_of_caller"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails42_haml.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gem 'nokogiri', RUBY_VERSION < '2.1' ? '~> 1.6.0' : '>= 1.7'
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
gem "haml"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails50.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
gem "rails", "~> 5.0.0"
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails50_boc.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem "rails", "~> 5.0.0"
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
gem "binding_of_caller"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails50_haml.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem "rails", "~> 5.0.0"
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
gem "haml"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails51.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
gem "rails", "~> 5.1.0"
gem 'i18n', '< 1.5.2', require: false if RUBY_VERSION < '2.3'

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails51_boc.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem "rails", "~> 5.1.0"
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
gem "binding_of_caller"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails51_haml.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem "rails", "~> 5.1.0"
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
gem "haml"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails52.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
gem "rails", "~> 5.2.0"
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails52_boc.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem "rails", "~> 5.2.0"
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
gem "binding_of_caller"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails52_haml.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem "rails", "~> 5.2.0"
gem 'i18n', '< 1.5.2' if RUBY_VERSION < '2.3'
gem "haml"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails60.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ source "https://rubygems.org"

gem "rails", "~> 6.0.0"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails60_boc.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
gem "rails", "~> 6.0.0"
gem "binding_of_caller"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
3 changes: 2 additions & 1 deletion gemfiles/rails60_haml.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source "https://rubygems.org"
gem "rails", "~> 6.0.0"
gem "haml"

gem 'coveralls', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false

gemspec path: "../"
26 changes: 15 additions & 11 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@

ENV["EDITOR"] = nil

# Ruby 2.4.0 and 2.4.1 has a bug with its Coverage module that causes segfaults.
# https://bugs.ruby-lang.org/issues/13305
# 2.4.2 should include this patch.
if ENV['CI']
unless RUBY_VERSION == '2.4.0' || RUBY_VERSION == '2.4.1'
require 'coveralls'
Coveralls.wear! do
add_filter 'spec/'
end
end
else
require 'simplecov'
SimpleCov.start
require 'simplecov-lcov'

SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = 'coverage/lcov.info'
end
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
[
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::LcovFormatter,
]
)
SimpleCov.start do
add_filter 'spec/'
end
end

require 'bundler/setup'
Expand Down

0 comments on commit d3e6b4e

Please sign in to comment.