From f3e4f6c58fe208aab6f8c039299b8f02d9056579 Mon Sep 17 00:00:00 2001 From: Valentine Kiselev Date: Sat, 6 Feb 2021 19:43:35 +0300 Subject: [PATCH] Add Codecov --- .github/workflows/ci.yml | 6 +++++- Gemfile.lock | 9 +++++++++ README.md | 4 ++++ sentry-sanitizer.gemspec | 6 +++++- spec/spec_helper.rb | 8 ++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ff841a..c06a25a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,5 +29,9 @@ jobs: - name: Run specs run: | - bundle install --jobs 4 --retry 3 --no-cache --frozen + bundle install --jobs 4 --retry 3 --no-cache bundle exec rspec + + - uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Gemfile.lock b/Gemfile.lock index 326ddb9..f9cbfd8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,8 +7,11 @@ PATH GEM remote: https://rubygems.org/ specs: + codecov (0.4.3) + simplecov (>= 0.15, < 0.22) concurrent-ruby (1.1.8) diff-lcs (1.4.4) + docile (1.3.5) faraday (1.3.0) faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) @@ -38,16 +41,22 @@ GEM sentry-ruby-core (4.2.0) concurrent-ruby faraday + simplecov (0.18.5) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov-html (0.12.3) PLATFORMS ruby DEPENDENCIES bundler (>= 1.17) + codecov rack rake (~> 10.0) rspec (~> 3.0) sentry-sanitizer! + simplecov (~> 0.18.5) BUNDLED WITH 2.1.4 diff --git a/README.md b/README.md index 897262b..035a7f9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +![CI](https://github.com/mrexox/sentry-sanitizer/workflows/CI/badge.svg) +[![Gem Version](https://badge.fury.io/rb/sentry-sanitizer.svg)](https://badge.fury.io/rb/sentry-sanitizer) +[![codecov](https://codecov.io/gh/mrexox/sentry-sanitizer/branch/master/graph/badge.svg?token=QW93HCVI0W)](https://codecov.io/gh/mrexox/sentry-sanitizer) + # sentry-sanitizer: sanitizing extension for sentry-ruby This gem claims to add sanitizing support to [sentry-ruby](https://rubygems.org/gems/sentry-ruby) gem. diff --git a/sentry-sanitizer.gemspec b/sentry-sanitizer.gemspec index 93a24c4..6b9ff71 100644 --- a/sentry-sanitizer.gemspec +++ b/sentry-sanitizer.gemspec @@ -11,7 +11,7 @@ Gem::Specification.new do |spec| spec.email = ['mrexox@outlook.com'] spec.summary = %q{Sanitizing middleware for sentry-ruby gem} - spec.description = %q{Add missing sanitizing support for sentry-ruby (previous sentry-rav)} + spec.description = %q{Add missing sanitizing support for sentry-ruby (previous sentry-raven)} spec.homepage = 'https://github.com/mrexox/sentry-sanitizer' spec.license = 'BSD' @@ -27,6 +27,10 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] + # Codecov + spec.add_development_dependency 'codecov' + spec.add_development_dependency 'simplecov', '~> 0.18.5' + spec.add_development_dependency 'bundler', '>= 1.17' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.0' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1ca4737..fb3c449 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,14 @@ require 'bundler/setup' require 'sentry/sanitizer' +if ENV['CI'] == 'true' + require 'simplecov' + require 'codecov' + + SimpleCov.start + SimpleCov.formatter = SimpleCov::Formatter::Codecov +end + RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = '.rspec_status'