Merge pull request #68 from taichi-ishitani/introduce_codecov_action

Introduce Codecov action
This commit is contained in:
Marc Siegel 2021-05-08 10:59:46 -04:00 committed by GitHub
commit 2716579ff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 6 deletions

View File

@ -23,3 +23,7 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rspec
- uses: codecov/codecov-action@v1
with:
name: ${{ matrix.ruby }}
file: ./coverage/coverage.xml

View File

@ -1,8 +1,8 @@
source "https://rubygems.org"
# CI-only dependencies go here
if ENV["CI"] == "true" && RUBY_ENGINE == "ruby"
gem "codecov", require: false, group: "test"
if ENV["CI"] == "true"
gem "simplecov-cobertura", require: false, group: "test"
end
# Specify gem's dependencies in docile.gemspec

View File

@ -6,10 +6,11 @@ begin
add_filter "/vendor/" # exclude gems which are cached in CI
end
# On CI we publish coverage to codecov.io, except on JRuby and TruffleRuby
if ENV["CI"] == "true" && RUBY_ENGINE == "ruby"
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
# On CI we publish coverage to codecov.io
# To use codecov-action, we need to generate XML based covarage report
if ENV["CI"] == "true"
require "simplecov-cobertura"
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end
# Due to circular dependency (simplecov depends on docile), remove docile and require again below