Skip to content

Commit e0d9e07

Browse files
committed
Use LCOV instead of JSON
1 parent 98aef53 commit e0d9e07

File tree

4 files changed

+28
-18
lines changed

4 files changed

+28
-18
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Run linting
4646
run: bundle exec rubocop
4747
- name: Run tests
48-
run: bundle exec rspec
48+
run: bundle exec rspec spec
4949

5050
# SonarCloud, Codecov, etc.
5151
external:
@@ -62,7 +62,7 @@ jobs:
6262
- name: Run linting
6363
run: bundle exec rubocop --format progress --format json --out rubocop.json
6464
- name: Run tests
65-
run: bundle exec rspec
65+
run: bundle exec rspec spec
6666
# SonarCloud
6767
- name: SonarCloud Scan
6868
uses: SonarSource/sonarcloud-github-action@master
@@ -83,4 +83,4 @@ jobs:
8383
with:
8484
debug: true
8585
coverageLocations: |
86-
coverage/coverage.json:simplecov
86+
coverage/lcov.info:lcov

Gemfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
88
gemspec
99

1010
group :development, :test do
11-
gem 'bundler', '~> 2.5.17'
12-
gem 'rake', '~> 13.2.1'
13-
gem 'rubocop', '~> 1.66.1'
14-
gem 'simplecov', '~> 0.22.0'
15-
gem 'simplecov-html', '~> 0.12.3'
16-
gem 'simplecov-json', '~> 0.2.0'
11+
gem 'bundler', '~> 2.5'
12+
gem 'rake', '~> 13.2'
13+
gem 'rubocop', '~> 1.66'
14+
gem 'simplecov', '~> 0.22'
15+
gem 'simplecov-html', '~> 0.12'
16+
gem 'simplecov-json', '~> 0.2'
17+
gem 'simplecov-lcov', '~> 0.8'
1718
end

Gemfile.lock

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ GEM
5656
simplecov-json (0.2.3)
5757
json
5858
simplecov
59+
simplecov-lcov (0.8.0)
5960
simplecov_json_formatter (0.1.4)
6061
unicode-display_width (2.5.0)
6162

@@ -65,13 +66,14 @@ PLATFORMS
6566
x86_64-darwin-19
6667

6768
DEPENDENCIES
68-
bundler (~> 2.5.17)
69-
rake (~> 13.2.1)
69+
bundler (~> 2.5)
70+
rake (~> 13.2)
7071
rspec-sonarqube-formatter!
71-
rubocop (~> 1.66.1)
72-
simplecov (~> 0.22.0)
73-
simplecov-html (~> 0.12.3)
74-
simplecov-json (~> 0.2.0)
72+
rubocop (~> 1.66)
73+
simplecov (~> 0.22)
74+
simplecov-html (~> 0.12)
75+
simplecov-json (~> 0.2)
76+
simplecov-lcov (~> 0.8)
7577

7678
BUNDLED WITH
7779
2.5.17

spec/spec_helper.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
require 'simplecov'
44
require 'simplecov-json'
55
require 'simplecov-html'
6+
require 'simplecov-lcov'
7+
8+
SimpleCov::Formatter::LcovFormatter.config do |c|
9+
c.single_report_path = 'coverage/lcov.info'
10+
c.report_with_single_file = true
11+
end
612

713
# Generate HTML and JSON reports
8-
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
14+
SimpleCov.formatters = [
915
SimpleCov::Formatter::HTMLFormatter,
10-
SimpleCov::Formatter::JSONFormatter
11-
])
16+
SimpleCov::Formatter::JSONFormatter,
17+
SimpleCov::Formatter::LcovFormatter
18+
]
1219

1320
# Code coverage
1421
SimpleCov.start do

0 commit comments

Comments
 (0)