Skip to content

Commit

Permalink
Switch code coverage tool
Browse files Browse the repository at this point in the history
Using SimpleCov directly and telling Coveralls after the fact, rather
than using COveralls directly.
  • Loading branch information
enkessler committed Jun 2, 2021
1 parent 8dc3cfe commit b77a958
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,20 @@ jobs:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run Tests
run: bundle exec rake spec
- name: Push code coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: "./coverage/lcov/lcov.info"
parallel: true
flag-name: run-${{ matrix.os }}-${{ matrix.ruby-version }}

test_finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
15 changes: 15 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'simplecov-lcov'


SimpleCov::Formatter::LcovFormatter.config do |config|
config.report_with_single_file = true
config.lcov_file_name = 'lcov.info'
end

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::LcovFormatter])

SimpleCov.start do
root __dir__
merge_timeout 300
end
3 changes: 2 additions & 1 deletion childprocess.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ Gem::Specification.new do |s|

s.add_development_dependency "rspec", "~> 3.0"
s.add_development_dependency "yard", "~> 0.0"
s.add_development_dependency 'coveralls', '< 1.0'
s.add_development_dependency 'simplecov', '< 1.0'
s.add_development_dependency 'simplecov-lcov', '< 1.0'
end
5 changes: 1 addition & 4 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

unless defined?(JRUBY_VERSION)
require 'coveralls'
Coveralls.wear!
end
require 'simplecov'

require 'childprocess'
require 'rspec'
Expand Down

0 comments on commit b77a958

Please sign in to comment.