From 5b4bd5b325d5df896af08caee01d0ff181d1e666 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 18 Dec 2024 18:27:55 +0000 Subject: [PATCH] Add coverage measurement and reporting --- .github/workflows/push.yml | 6 +++++- caber.gemspec | 1 + spec/rails_helper.rb | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ca18e43..5cd1ebd 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -13,7 +13,11 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - name: Run tests - run: bundle exec rake spec + uses: paambaati/codeclimate-action@v9.0.0 + with: + coverageCommand: bundle exec rake spec + env: + CC_TEST_REPORTER_ID: 5dd5918c241368d9507f58b71461de2d22d4f18ca23aadb23dc7ff2d707dabf6 lint: runs-on: ubuntu-latest steps: diff --git a/caber.gemspec b/caber.gemspec index 83b9818..1c5773d 100644 --- a/caber.gemspec +++ b/caber.gemspec @@ -22,4 +22,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency "rspec-rails", "~> 6.1" spec.add_development_dependency "factory_bot_rails", "~> 6.4" spec.add_development_dependency "standardrb" + spec.add_development_dependency "simplecov", "~> 0.22" end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 6eed220..940cfdd 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -1,4 +1,7 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' +require "simplecov"] +SimpleCov.start :rails + require "spec_helper" ENV["RAILS_ENV"] ||= "test" require File.expand_path("../dummy/config/environment", __FILE__)