Skip to content

Commit

Permalink
Add the CoberturaFormatter
Browse files Browse the repository at this point in the history
Uploading the XML-formatted report to codecov via GitHub action.
  • Loading branch information
adomokos committed Sep 8, 2024
1 parent 7859ac1 commit eaaa903
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/project-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,22 @@ jobs:
RUN_COVERAGE_REPORT: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
- name: Checkout
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Run specs and Rubocop
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rspec spec
- run: bundle exec rubocop
run: bundle exec rspec spec
run: bundle exec rubocop
- name: Upload coverage report
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage/coverage.xml # optional
flags: unittests # optional
verbose: true # optional (default = false)
2 changes: 1 addition & 1 deletion light-service.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency("test-unit", "~> 3.0") # Needed for generator specs.
gem.add_development_dependency("rspec", "~> 3.0")
gem.add_development_dependency("simplecov", "~> 0.17")
gem.add_development_dependency("codecov", "~> 0.1")
gem.add_development_dependency("simplecov-cobertura", "~> 2.1")
gem.add_development_dependency("rubocop", "~> 1.26.0")
gem.add_development_dependency("rubocop-performance", "~> 1.2.0")
gem.add_development_dependency("pry", "~> 0.14")
Expand Down
6 changes: 4 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
end
SimpleCov.minimum_coverage_by_file 90

require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
# require 'codecov'
# SimpleCov.formatter = SimpleCov::Formatter::Codecov
end

require 'light-service'
Expand Down

0 comments on commit eaaa903

Please sign in to comment.