From d4e579d4ec810400ada7bbb2f1b73d87478b8fb3 Mon Sep 17 00:00:00 2001 From: matt robinson Date: Sun, 5 Nov 2023 08:37:26 -0500 Subject: [PATCH] re-enable cc test reporting (#48) * re-enable cc test reporting * simplecov json output in ci * only report for latest * badges --- .github/workflows/ci.yml | 8 ++++++++ Gemfile | 1 + README.md | 3 ++- gemfiles/sidekiq_6.4.gemfile | 1 + gemfiles/sidekiq_6.5.gemfile | 1 + gemfiles/sidekiq_7.0.gemfile | 1 + gemfiles/sidekiq_7.1.gemfile | 1 + test/helper.rb | 4 ++++ 8 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e62293..bfb7796 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,3 +43,11 @@ jobs: - name: Run tests run: bundle exec rake timeout-minutes: 5 + - name: Report code coverage + if: ${{ matrix.ruby-version == '3.2' && matrix.sidekiq-version == '7.1' }} + continue-on-error: true + uses: paambaati/codeclimate-action@v5.0.0 + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + with: + coverageLocations: ${{ github.workspace }}/coverage/coverage.json:simplecov diff --git a/Gemfile b/Gemfile index 9cf3d83..b41a982 100644 --- a/Gemfile +++ b/Gemfile @@ -17,4 +17,5 @@ gem 'sidekiq', sidekiq_dep group :test do gem "simplecov" + gem "simplecov_json_formatter" end diff --git a/README.md b/README.md index b6b6ed9..977fa6f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ [![CI](https://github.com/mattyr/sidecloq/actions/workflows/ci.yml/badge.svg)](https://github.com/mattyr/sidecloq/actions/workflows/ci.yml) [![Gem Version](https://badge.fury.io/rb/sidecloq.svg)](https://badge.fury.io/rb/sidecloq) -[![Test Coverage](https://codeclimate.com/github/mattyr/sidecloq/badges/coverage.svg)](https://codeclimate.com/github/mattyr/sidecloq/coverage) +[![Test Coverage](https://api.codeclimate.com/v1/badges/65e94000ebd0b9043b1d/test_coverage)](https://codeclimate.com/github/mattyr/sidecloq/test_coverage) +[![Maintainability](https://api.codeclimate.com/v1/badges/65e94000ebd0b9043b1d/maintainability)](https://codeclimate.com/github/mattyr/sidecloq/maintainability) Recurring / Periodic / Scheduled / Cron job extension for [Sidekiq](https://github.com/mperham/sidekiq) diff --git a/gemfiles/sidekiq_6.4.gemfile b/gemfiles/sidekiq_6.4.gemfile index 0fd3bcc..d60c8cf 100644 --- a/gemfiles/sidekiq_6.4.gemfile +++ b/gemfiles/sidekiq_6.4.gemfile @@ -6,6 +6,7 @@ gem "sidekiq", "~> 6.4.0" group :test do gem "simplecov" + gem "simplecov_json_formatter" end platforms :mri, :rbx do diff --git a/gemfiles/sidekiq_6.5.gemfile b/gemfiles/sidekiq_6.5.gemfile index d61b2ad..cb0fcd2 100644 --- a/gemfiles/sidekiq_6.5.gemfile +++ b/gemfiles/sidekiq_6.5.gemfile @@ -6,6 +6,7 @@ gem "sidekiq", "~> 6.5.0" group :test do gem "simplecov" + gem "simplecov_json_formatter" end platforms :mri, :rbx do diff --git a/gemfiles/sidekiq_7.0.gemfile b/gemfiles/sidekiq_7.0.gemfile index 12732cd..17d2177 100644 --- a/gemfiles/sidekiq_7.0.gemfile +++ b/gemfiles/sidekiq_7.0.gemfile @@ -6,6 +6,7 @@ gem "sidekiq", "~> 7.0.0" group :test do gem "simplecov" + gem "simplecov_json_formatter" end platforms :mri, :rbx do diff --git a/gemfiles/sidekiq_7.1.gemfile b/gemfiles/sidekiq_7.1.gemfile index d24c0a8..e730bfd 100644 --- a/gemfiles/sidekiq_7.1.gemfile +++ b/gemfiles/sidekiq_7.1.gemfile @@ -6,6 +6,7 @@ gem "sidekiq", "~> 7.1.0" group :test do gem "simplecov" + gem "simplecov_json_formatter" end platforms :mri, :rbx do diff --git a/test/helper.rb b/test/helper.rb index 40fa009..28168c6 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -1,4 +1,8 @@ require 'simplecov' +if ENV['CI'] + require 'simplecov_json_formatter' + SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter +end SimpleCov.start $TESTING = true