Skip to content

Commit

Permalink
fix: coveralls test coverage reporting to use GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjalbert committed Oct 25, 2021
1 parent 82f5ea0 commit f264cdf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ jobs:

- name: Ruby tests
run: bundle exec rspec

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gemspec

group :test do
gem 'simplecov'
gem 'coveralls', require: false
gem 'simplecov-lcov'
gem 'rspec'
end

Expand Down
22 changes: 11 additions & 11 deletions spec/support/coverage.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
begin
require 'simplecov'

SimpleCov.start 'rails' do
if ENV['CI']
require 'coveralls'
Coveralls.wear!
elsif ENV['COVERAGE']
require 'simplecov'
end
require 'simplecov-lcov'

if ENV['CI'] || ENV['COVERAGE']
SimpleCov.start do
add_filter '/spec/'
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = 'coverage/lcov.info'
end

formatter SimpleCov::Formatter::LcovFormatter
end
rescue LoadError => e
warn(e)

add_filter %w[version.rb initializer.rb]
end

0 comments on commit f264cdf

Please sign in to comment.