From 434cc59ae86511fc6ccd88516e7f03fa51601516 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Thu, 18 Feb 2021 13:18:31 +0100 Subject: [PATCH] Use GitHub Actions to upload Coveralls report --- .github/workflows/ruby.yml | 6 +++++- Gemfile | 2 +- Gemfile.lock | 25 ++----------------------- spec/spec_helper.rb | 9 +++++++++ 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 93d0c02b..34b5ce06 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -50,6 +50,10 @@ jobs: - name: Run tests run: bundle exec rake rspec-rerun:spec env: - COVERALLS: 1 + COVERAGE: lcov DATABASE_URL: mysql2://user:password@127.0.0.1/test RAILS_ENV: test + - name: Upload coverage report to Coveralls + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/Gemfile b/Gemfile index 4043fa67..b8aa6a4a 100644 --- a/Gemfile +++ b/Gemfile @@ -111,7 +111,7 @@ group :test do gem 'i18n-spec' # code coverage gem 'simplecov', require: false - gem 'coveralls', require: false + gem 'simplecov-lcov', require: false # api gem 'apivore', require: false gem 'hashie', '~> 3.4.6', require: false # https://github.com/westfieldlabs/apivore/issues/114 diff --git a/Gemfile.lock b/Gemfile.lock index e2edb9f7..ad4e2c80 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -166,12 +166,6 @@ GEM concurrent-ruby (1.1.7) connection_pool (2.2.3) content_for_in_controllers (0.0.2) - coveralls (0.7.1) - multi_json (~> 1.3) - rest-client - simplecov (>= 0.7) - term-ansicolor - thor crass (1.0.6) daemons (1.3.1) database_cleaner (1.8.5) @@ -186,8 +180,6 @@ GEM diff-lcs (1.4.4) diffy (3.4.0) docile (1.3.2) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) doorkeeper (5.4.0) railties (>= 5) doorkeeper-i18n (5.2.2) @@ -232,9 +224,6 @@ GEM nokogiri (>= 1.6.0) ruby_parser (~> 3.5) htmlentities (4.3.4) - http-accept (1.7.0) - http-cookie (1.0.3) - domain_name (~> 0.5) i18n (1.8.5) concurrent-ruby (~> 1.0) i18n-js (3.0.11) @@ -315,7 +304,6 @@ GEM mustermann (1.1.1) ruby2_keywords (~> 0.0.1) mysql2 (0.5.3) - netrc (0.11.0) nio4r (2.5.2) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) @@ -412,11 +400,6 @@ GEM redis-namespace (~> 1.6) sinatra (>= 0.9.2) vegas (~> 0.1.2) - rest-client (2.1.0) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) roo (2.8.3) nokogiri (~> 1) rubyzip (>= 1.3.0, < 3.0.0) @@ -479,6 +462,7 @@ GEM docile (~> 1.1) simplecov-html (~> 0.11) simplecov-html (0.12.2) + simplecov-lcov (0.8.0) sinatra (2.1.0) mustermann (~> 1.0) rack (~> 2.2) @@ -499,10 +483,7 @@ GEM sqlite3 (1.3.13) sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3) - sync (0.5.0) temple (0.8.2) - term-ansicolor (1.7.1) - tins (~> 1.0) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref @@ -513,8 +494,6 @@ GEM thor (1.0.1) thread_safe (0.3.6) tilt (2.0.10) - tins (1.25.0) - sync ttfunk (1.6.2.1) twitter-bootstrap-rails (2.2.8) actionpack (>= 3.1) @@ -569,7 +548,6 @@ DEPENDENCIES bullet capybara connection_pool - coveralls daemons database_cleaner date_time_attribute @@ -630,6 +608,7 @@ DEPENDENCIES simple-navigation-bootstrap simple_form simplecov + simplecov-lcov spreadsheet sprockets (< 4) sqlite3 (~> 1.3.6) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8f96ef83..1bf89702 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -58,6 +58,15 @@ RSpec.configure do |config| config.infer_spec_type_from_file_location! end +if ENV['COVERAGE'] == 'lcov' + require 'simplecov-lcov' + SimpleCov::Formatter::LcovFormatter.config do |c| + c.report_with_single_file = true + c.single_report_path = 'coverage/lcov.info' + end + SimpleCov.formatters = SimpleCov::Formatter::LcovFormatter +end + # include default foodsoft scope in urls, so that *_path works # https://github.com/rspec/rspec-rails/issues/255 class ActionDispatch::Routing::RouteSet