diff --git a/.github/workflows/rubyonrails.yml b/.github/workflows/rubyonrails.yml index 94e3f1c..3504337 100644 --- a/.github/workflows/rubyonrails.yml +++ b/.github/workflows/rubyonrails.yml @@ -36,6 +36,14 @@ jobs: run: bundle exec rails db:schema:load db:seed - name: Run tests run: bundle exec rake + - name: Publish code coverage + uses: paambaati/codeclimate-action@v9.0.0 + env: + CC_TEST_REPORTER_ID: "7b61fa9ea465e19ec3d750aafc3622cba4bf8b257d61f9ea20c46900bbe03fda" + with: + coverageLocations: | + ${{github.workspace}}/coverage/lcov/dragnet.lcov:lcov + debug: true lint: runs-on: ubuntu-latest @@ -46,6 +54,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true + # Add or replace any other lints here - name: Security audit dependencies run: bundle exec rake bundle:audit:update bundle:audit:check - name: Security audit application code diff --git a/.gitignore b/.gitignore index 3c47c88..6498f78 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ app/assets/javascripts/frontend/.calva/output-window/output.calva-repl /coverage/.last_run.json /coverage/.resultset.json.lock /coverage/.resultset.json +/coverage/lcov/ diff --git a/Gemfile b/Gemfile index 79cd2e8..21dc16e 100644 --- a/Gemfile +++ b/Gemfile @@ -76,6 +76,8 @@ end group :test do gem 'simplecov', require: false gem 'simplecov-small-badge', require: false + gem 'simplecov-lcov', require: false + gem 'rails-controller-testing' end diff --git a/Gemfile.lock b/Gemfile.lock index 832f872..4d840b1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -428,6 +428,7 @@ GEM simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) + simplecov-lcov (0.8.0) simplecov-small-badge (0.2.7) repo-small-badge (~> 0.2.10) simplecov (~> 0.18) @@ -541,6 +542,7 @@ DEPENDENCIES sentimental shortuuid simplecov + simplecov-lcov simplecov-small-badge sprockets-rails transit-rails diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7935a99..3e55035 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,11 +2,14 @@ require 'simplecov' require 'simplecov_small_badge' +require 'simplecov-lcov' SimpleCov.start('rails') do + SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([ SimpleCov::Formatter::HTMLFormatter, - SimpleCovSmallBadge::Formatter + SimpleCovSmallBadge::Formatter, + SimpleCov::Formatter::LcovFormatter, ]) end