up: adds converage

main
Washington Botelho 2022-05-17 22:48:47 -03:00
parent b23b61bc67
commit 2f8f719fc4
4 changed files with 47 additions and 0 deletions

View File

@ -39,10 +39,28 @@ jobs:
ruby-version: ${{ matrix.ruby }}
- name: Runs tests
env:
CI: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVERAGE: true
MINIMUM_COVERAGE: 80
run: bundle exec rake spec
- name: Runs tests with config enabled
env:
CI: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVERAGE: true
MINIMUM_COVERAGE: 80
run: bundle exec rake spec_config
- name: Runs tests with config enabled for extra scopes
env:
CI: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVERAGE: true
MINIMUM_COVERAGE: 80
run: bundle exec rake spec_config_with_extra_scopes

View File

@ -32,6 +32,8 @@ GEM
tzinfo (~> 2.0)
ast (2.4.2)
builder (3.2.4)
codecov (0.6.0)
simplecov (>= 0.15, < 0.22)
concurrent-ruby (1.1.10)
crass (1.0.6)
database_cleaner (2.0.1)
@ -41,6 +43,7 @@ GEM
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
diff-lcs (1.5.0)
docile (1.4.0)
erubi (1.10.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
@ -122,6 +125,12 @@ GEM
ruby-progressbar (1.11.0)
shoulda-matchers (5.1.0)
activesupport (>= 5.2.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
thor (1.2.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
@ -132,6 +141,7 @@ PLATFORMS
ruby
DEPENDENCIES
codecov
database_cleaner
factory_bot_rails
mysql2

View File

@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'activerecord'
spec.add_development_dependency 'codecov'
spec.add_development_dependency 'database_cleaner'
spec.add_development_dependency 'factory_bot_rails'
spec.add_development_dependency 'mysql2'

View File

@ -0,0 +1,18 @@
# frozen_string_literal: true
if ENV.fetch('COVERAGE', 'false') == 'true'
require 'simplecov'
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
SimpleCov.minimum_coverage(ENV.fetch('MINIMUM_COVERAGE', 80).to_i)
SimpleCov.start('rails') do
add_filter [
'/lib/generators',
'/lib/rating/version.rb',
'/vendor',
]
end
end