diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index da77e42..aff7587 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -7,16 +7,14 @@ name: Code Coverage -on: [push, workflow_dispatch, pull_request] +on: [pull_request] permissions: contents: read jobs: test: - permissions: - checks: write - contents: write + permissions: write-all runs-on: ubuntu-20.04 strategy: matrix: @@ -35,10 +33,8 @@ jobs: - name: Run tests run: bundle exec rake - name: Code Coverage - uses: joshmfrankel/simplecov-check-action@main + uses: romeovs/lcov-reporter-action@v0.3.1 with: - check_job_name: Code Coverage - github_token: ${{ secrets.GITHUB_TOKEN }} - minimum_suite_coverage: 100 + lcov-file: ./coverage/lcov/cached_resource.lcov - name: Lint uses: standardrb/standard-ruby-action@v1 diff --git a/cached_resource.gemspec b/cached_resource.gemspec index a7371ff..ff377db 100644 --- a/cached_resource.gemspec +++ b/cached_resource.gemspec @@ -25,7 +25,8 @@ Gem::Specification.new do |s| s.add_development_dependency "pry-byebug" s.add_development_dependency "rake" s.add_development_dependency "rspec" + s.add_development_dependency "simplecov-lcov", "~> 0.8.0" s.add_development_dependency "simplecov", "~> 0.22.0" - s.add_development_dependency "timecop", "~> 0.9.10" s.add_development_dependency "standard", "~> 1.39", ">= 1.39.1" + s.add_development_dependency "timecop", "~> 0.9.10" end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 86a757b..476db5c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,9 +1,17 @@ require "simplecov" +require "simplecov-lcov" + +SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true SimpleCov.start do add_filter "/spec/" add_group "Lib", "lib/" minimum_coverage 100 refuse_coverage_drop + + formatter SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::LcovFormatter, + SimpleCov::Formatter::HTMLFormatter + ]) end require "rubygems"