From 26d0c0e32752e1c5c6a6b20dbecf66c6c5ff82fb Mon Sep 17 00:00:00 2001 From: Taichi Ishitani Date: Fri, 7 May 2021 22:49:58 +0900 Subject: [PATCH] use codecov action instead of codecov gem --- .github/workflows/main.yml | 4 ++++ Gemfile | 4 ++-- spec/spec_helper.rb | 9 +++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6543979..d156d94 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,3 +24,7 @@ jobs: bundler-cache: false - run: bundle install - run: bundle exec rspec + - uses: codecov/codecov-action@v1 + with: + name: ${{ matrix.ruby }} + file: ./coverage/coverage.xml diff --git a/Gemfile b/Gemfile index 374d23d..9a983be 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index aae8481..a2173e1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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