From e8e72234a8edf08c2686c483d4dadce951ef00cc Mon Sep 17 00:00:00 2001 From: Hamed Asghari Date: Wed, 26 Feb 2020 22:22:43 -0700 Subject: [PATCH] Add codeclimate test coverage --- .github/workflows/ruby.yml | 10 ++++++++-- Gemfile.lock | 8 ++++++++ README.md | 2 ++ conifer.gemspec | 1 + spec/spec_helper.rb | 3 +++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 637f3e7..6f7a831 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -13,8 +13,14 @@ jobs: uses: actions/setup-ruby@v1 with: ruby-version: 2.6.x - - name: Build and test with RSpec + - name: Configure Bundler run: | gem install bundler -v 1.17.3 --no-document bundle install --jobs 4 --retry 3 - bundle exec rspec + - name: Run tests with RSpec + uses: paambaati/codeclimate-action@v2.5.3 + env: + CC_TEST_REPORTER_ID: 0e4e712966b3d2fdf63128dc4d0c863fd4c61888b557ffb1673111b4c8b3bdc9 + with: + coverageCommand: bundle exec rspec + debug: false diff --git a/Gemfile.lock b/Gemfile.lock index c724d98..cc94f37 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,6 +7,8 @@ GEM remote: https://rubygems.org/ specs: diff-lcs (1.3) + docile (1.3.2) + json (2.3.0) rake (10.5.0) rspec (3.8.0) rspec-core (~> 3.8.0) @@ -21,6 +23,11 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) rspec-support (3.8.2) + simplecov (0.16.1) + docile (~> 1.1) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.2) PLATFORMS ruby @@ -30,6 +37,7 @@ DEPENDENCIES conifer! rake (~> 10.0) rspec (~> 3.0) + simplecov (= 0.16.1) BUNDLED WITH 1.17.3 diff --git a/README.md b/README.md index 4a70f35..73f10e8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ ![](https://github.com/hasghari/conifer/workflows/Ruby/badge.svg) +[![Maintainability](https://api.codeclimate.com/v1/badges/f02c1de9e9d7dbfa5800/maintainability)](https://codeclimate.com/github/hasghari/conifer/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/f02c1de9e9d7dbfa5800/test_coverage)](https://codeclimate.com/github/hasghari/conifer/test_coverage) # Conifer diff --git a/conifer.gemspec b/conifer.gemspec index fafabeb..c586cf1 100644 --- a/conifer.gemspec +++ b/conifer.gemspec @@ -27,4 +27,5 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler', '~> 1.17' spec.add_development_dependency 'rake', '~> 10.0' spec.add_development_dependency 'rspec', '~> 3.0' + spec.add_development_dependency 'simplecov', '0.16.1' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 070cfd9..0ff44aa 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +require 'simplecov' +SimpleCov.start + require 'bundler/setup' require 'conifer'