From 5bb94927a23571c121919be41e0648041b12859b Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Thu, 30 Apr 2020 20:12:13 +0200 Subject: [PATCH] Add codecov --- .github/workflows/retrospring.yml | 1 + Gemfile | 2 +- Gemfile.lock | 9 ++++++--- spec/support/simplecov.rb | 7 +++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/retrospring.yml b/.github/workflows/retrospring.yml index bf6914fb..fc052a12 100644 --- a/.github/workflows/retrospring.yml +++ b/.github/workflows/retrospring.yml @@ -65,5 +65,6 @@ jobs: - name: Run tests run: bundle exec rake spec env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }} REDIS_URL: "redis://localhost:${{ job.services.redis.ports[6379] }}" diff --git a/Gemfile b/Gemfile index 1fe983a4..fb90b52c 100644 --- a/Gemfile +++ b/Gemfile @@ -98,7 +98,7 @@ group :development, :test do gem 'poltergeist' gem 'simplecov', require: false gem 'simplecov-json', require: false - gem 'simplecov-rcov', require: false + gem 'codecov', require: false gem 'database_cleaner' gem 'better_errors' gem 'letter_opener' # Use this just in local test environments diff --git a/Gemfile.lock b/Gemfile.lock index 31414a32..e6d75ba7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -100,6 +100,10 @@ GEM xpath (~> 3.2) climate_control (0.2.0) cliver (0.3.2) + codecov (0.1.16) + json + simplecov + url coderay (1.1.2) coffee-rails (4.2.2) coffee-script (>= 2.2.0) @@ -448,8 +452,6 @@ GEM simplecov-json (0.2.1) json simplecov - simplecov-rcov (0.2.3) - simplecov (>= 0.4.1) spring (2.1.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) @@ -492,6 +494,7 @@ GEM unicorn (5.5.4) kgio (~> 2.6) raindrops (~> 0.7) + url (0.3.2) warden (1.2.8) rack (>= 2.0.6) web-console (3.7.0) @@ -518,6 +521,7 @@ DEPENDENCIES brakeman byebug capybara + codecov coffee-rails (~> 4.1) colorize database_cleaner @@ -574,7 +578,6 @@ DEPENDENCIES sidekiq (< 6) simplecov simplecov-json - simplecov-rcov spring (~> 2.0) sweetalert-rails timecop diff --git a/spec/support/simplecov.rb b/spec/support/simplecov.rb index 2cc94286..aa93ee94 100644 --- a/spec/support/simplecov.rb +++ b/spec/support/simplecov.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true require "simplecov" -# require "simplecov-rcov" -# SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter SimpleCov.start "rails" + +if ENV.key?("CODECOV_TOKEN") + require "codecov" + SimpleCov.formatter = SimpleCov::Formatter::Codecov +end