Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#554] Add formatter for codecov #5

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
codecov:
runs-on: ubuntu-22.04
Expand All @@ -14,8 +17,7 @@ jobs:
ruby-version: '2.7'
- run: bundle update
- run: bundle exec rake
- uses: codecov/codecov-action@v4.0.0-beta.3
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/.resultset.json
fail_ci_if_error: true
6 changes: 5 additions & 1 deletion .simplecov
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ end

SimpleCov.start do
add_filter '/test/'
add_filter '/test-assets/'
add_filter '/features/'
# minimum_coverage 30
add_filter '/assets/'
add_filter '/dynamodb-local/'
add_filter '/public/'
minimum_coverage 34
end
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ gem 'ruby-fann', '1.4.1'
gem 'sass', '3.7.4'
gem 'sentry-raven', '3.1.2'
gem 'simplecov', '0.22.0'
gem 'simplecov-cobertura', '~> 2.1'
gem 'sinatra', '3.0.6'
gem 'sinatra-contrib', '3.0.6'
gem 'sprockets', '4.2.1'
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ GEM
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sinatra (3.0.6)
Expand Down Expand Up @@ -239,6 +242,7 @@ DEPENDENCIES
sass (= 3.7.4)
sentry-raven (= 3.1.2)
simplecov (= 0.22.0)
simplecov-cobertura (~> 2.1)
sinatra (= 3.0.6)
sinatra-contrib (= 3.0.6)
sprockets (= 4.2.1)
Expand Down
3 changes: 3 additions & 0 deletions test/test__helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
require 'simplecov'
SimpleCov.start

require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter

def object(hash)
json = hash.to_json
JSON.parse(json, object_class: OpenStruct)
Expand Down