Skip to content

Commit 1f47457

Browse files
committed
add in code-coverage reporting
1 parent 40d9c2e commit 1f47457

6 files changed

Lines changed: 41 additions & 3 deletions

File tree

.github/workflows/prs.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,22 @@ jobs:
4343
run: bundle exec rspec
4444
- name: Run rubocop
4545
run: bundle exec rubocop
46+
- name: Coveralls Parallel
47+
if: "${{ !env.ACT }}"
48+
uses: coverallsapp/github-action@master
49+
with:
50+
github-token: "${{ secrets.GITHUB_TOKEN }}"
51+
flag-name: run-${{ matrix.ruby }}-${{ matrix.activerecord }}
52+
parallel: true
4653
finish:
4754
name: All CI Tests Passed
4855
needs:
4956
- test
5057
runs-on: ubuntu-latest
5158
steps:
52-
- name: 'All tests finished'
53-
run: echo "All tests finished"
59+
- name: Coveralls Finished
60+
if: "${{ !env.ACT }}"
61+
uses: coverallsapp/github-action@master
62+
with:
63+
github-token: "${{ secrets.GITHUB_TOKEN }}"
64+
parallel-finished: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ gemfiles/*.lock
88
.ruby-version
99
.ruby-gemset
1010
.rspec
11+
/coverage

.simplecov

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# frozen_string_literal: true
2+
3+
SimpleCov.configure do
4+
enable_coverage :branch
5+
add_filter '/spec/'
6+
7+
add_group 'Binaries', '/bin/'
8+
add_group 'Libraries', '/lib/'
9+
10+
if ENV['CI']
11+
require 'simplecov-lcov'
12+
13+
SimpleCov::Formatter::LcovFormatter.config do |c|
14+
c.report_with_single_file = true
15+
c.single_report_path = 'coverage/lcov.info'
16+
end
17+
18+
formatter SimpleCov::Formatter::LcovFormatter
19+
end
20+
end

README.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![Build Status](https://github.com/OutOfOrder/multidb/actions/workflows/prs.yml/badge.svg)](https://github.com/OutOfOrder/multidb/actions)
2+
[![Coverage Status](https://coveralls.io/repos/github/OutOfOrder/multidb/badge.svg?branch=master)](https://coveralls.io/github/OutOfOrder/multidb?branch=master)
23

34
# Multidb
45

ar-multidb.gemspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Gem::Specification.new do |s|
2525

2626
s.add_development_dependency 'rake', '~> 13.0'
2727
s.add_development_dependency 'rspec', '~> 3.8'
28-
s.add_development_dependency 'rubocop', '~> 1.12'
28+
s.add_development_dependency 'rubocop', '~> 1.28'
29+
s.add_development_dependency 'simplecov', '~> 0.21.2'
30+
s.add_development_dependency 'simplecov-lcov', '~> 0.8.0'
2931
s.add_development_dependency 'sqlite3', '~> 1.3'
3032
end

spec/spec_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# frozen_string_literal: true
22

3+
require 'simplecov'
4+
SimpleCov.start
5+
36
ENV['RACK_ENV'] ||= 'test'
47

58
require 'rspec'

0 commit comments

Comments
 (0)