Skip to content

Commit 54919ef

Browse files
authored
Merge pull request #35 from blocknotes/setup-code-climate
Setup Code Climate
2 parents 06db830 + 8a4673b commit 54919ef

4 files changed

Lines changed: 25 additions & 5 deletions

File tree

.github/workflows/specs.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ name: Specs
33

44
on:
55
push:
6-
branches: [develop, main]
6+
branches: [main]
77
pull_request:
8-
branches: [develop, main]
8+
branches: [main]
99

1010
jobs:
11-
test:
11+
tests:
1212
runs-on: ubuntu-latest
1313

1414
strategy:
1515
matrix:
1616
ruby: ['2.6', '2.7', '3.0']
1717

1818
steps:
19-
- name: Checkout
19+
- name: Checkout repository
2020
uses: actions/checkout@v2
2121

2222
- name: Set up Ruby
@@ -26,4 +26,12 @@ jobs:
2626
bundler-cache: true
2727

2828
- name: Run tests
29-
run: bin/rspec --profile
29+
run: bundle exec rspec --profile
30+
31+
- name: Code Climate test coverage
32+
uses: paambaati/codeclimate-action@v3.0.0
33+
env:
34+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
35+
with:
36+
coverageLocations: |
37+
${{github.workspace}}/coverage/lcov/prawn-html.lcov:lcov

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ source 'https://rubygems.org'
55
gemspec
66

77
group :development, :test do
8+
# Testing
89
gem 'pdf-inspector', require: 'pdf/inspector'
910
gem 'rspec'
1011
gem 'simplecov', require: false
12+
gem 'simplecov-lcov', require: false
1113

1214
# Linters
1315
gem 'fasterer'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Prawn HTML
22
[![gem version](https://badge.fury.io/rb/prawn-html.svg)](https://rubygems.org/gems/prawn-html)
3+
[![gem downloads](https://badgen.net/rubygems/dt/prawn-html)](https://rubygems.org/gems/prawn-html)
4+
[![maintainability](https://api.codeclimate.com/v1/badges/db674db00817d56ca1e9/maintainability)](https://codeclimate.com/github/blocknotes/prawn-html/maintainability)
35
[![linters](https://github.com/blocknotes/prawn-html/actions/workflows/linters.yml/badge.svg)](https://github.com/blocknotes/prawn-html/actions/workflows/linters.yml)
46
[![specs](https://github.com/blocknotes/prawn-html/actions/workflows/specs.yml/badge.svg)](https://github.com/blocknotes/prawn-html/actions/workflows/specs.yml)
57

spec/spec_helper.rb

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

33
require 'simplecov'
4+
require 'simplecov-lcov'
5+
6+
SimpleCov::Formatter::LcovFormatter.config do |c|
7+
c.report_with_single_file = true
8+
# c.single_report_path = ENV['LCOV_PATH'] if ENV['LCOV_PATH'].present?
9+
end
10+
simplecov_formatters = [SimpleCov::Formatter::LcovFormatter, SimpleCov.formatter]
11+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(simplecov_formatters)
412
SimpleCov.start do
513
add_filter '/spec/'
614
end

0 commit comments

Comments
 (0)