Skip to content

Commit 21f5d84

Browse files
authored
chore: add coverage (#5)
1 parent 8de4c36 commit 21f5d84

File tree

5 files changed

+40
-10
lines changed

5 files changed

+40
-10
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@ jobs:
3131
bundle install --jobs 4 --retry 3 --no-cache
3232
bundle exec rspec
3333
34-
- uses: codecov/codecov-action@v1
34+
- uses: mrexox/coveralls-github-action@feat/add-carryforward-flag
3535
with:
36-
token: ${{ secrets.CODECOV_TOKEN }}
36+
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
flag-name: ruby-${{ matrix.ruby_version }}
38+
path-to-lcov: ./coverage/lcov/sentry-sanitizer.lcov
39+
parallel: true
40+
41+
coverage:
42+
needs: rspec
43+
name: Unit tests
44+
if: ${{ always() }}
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: mrexox/coveralls-github-action@feat/add-carryforward-flag
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
carryforward: "ruby-2.5,ruby-2.7,ruby-3.0,ruby-3.1,ruby-jruby"
51+
parallel-finished: true
52+

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
44

55
# Specify your gem's dependencies in sentry-sanitizer.gemspec
66
gemspec
7+
8+
gem 'simplecov', require: false, group: :test
9+
gem 'simplecov-lcov', require: false, group: :test

Gemfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ GEM
3333
docile (~> 1.1)
3434
simplecov-html (~> 0.11)
3535
simplecov-html (0.12.3)
36+
simplecov-lcov (0.8.0)
3637

3738
PLATFORMS
3839
ruby
@@ -44,7 +45,8 @@ DEPENDENCIES
4445
rake (~> 10.0)
4546
rspec (~> 3.0)
4647
sentry-sanitizer!
47-
simplecov (~> 0.18.5)
48+
simplecov
49+
simplecov-lcov
4850

4951
BUNDLED WITH
5052
2.3.16

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![CI](https://github.com/mrexox/sentry-sanitizer/workflows/CI/badge.svg)
22
[![Gem Version](https://badge.fury.io/rb/sentry-sanitizer.svg)](https://badge.fury.io/rb/sentry-sanitizer)
3-
[![codecov](https://codecov.io/gh/mrexox/sentry-sanitizer/branch/master/graph/badge.svg?token=QW93HCVI0W)](https://codecov.io/gh/mrexox/sentry-sanitizer)
3+
[![Coverage Status](https://coveralls.io/repos/github/mrexox/sentry-sanitizer/badge.svg?branch=master)](https://coveralls.io/github/mrexox/sentry-sanitizer?branch=master)
44

55
# sentry-sanitizer: sanitizing extension for sentry-ruby
66

spec/spec_helper.rb

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
require 'bundler/setup'
2-
require 'sentry/sanitizer'
3-
41
if ENV['CI'] == 'true'
52
require 'simplecov'
6-
require 'codecov'
3+
require 'simplecov-lcov'
4+
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
5+
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
6+
SimpleCov.start do
7+
add_filter '/spec/'
8+
enable_coverage :branch
9+
end
710

8-
SimpleCov.start
9-
SimpleCov.formatter = SimpleCov::Formatter::Codecov
11+
# require 'simplecov'
12+
# require 'codecov'
13+
14+
# SimpleCov.start
15+
# SimpleCov.formatter = SimpleCov::Formatter::Codecov
1016
end
1117

18+
require 'bundler/setup'
19+
require 'sentry/sanitizer'
20+
1221
RSpec.configure do |config|
1322
# Enable flags like --only-failures and --next-failure
1423
config.example_status_persistence_file_path = '.rspec_status'

0 commit comments

Comments
 (0)