Skip to content

Commit 803ded0

Browse files
committed
Re-add code coverage.
1 parent 2270002 commit 803ded0

File tree

8 files changed

+42
-11
lines changed

8 files changed

+42
-11
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/workflows/coverage.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: coverage
3+
on: [push, pull_request]
4+
5+
env:
6+
COVERAGE: 1
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Install Ruby (2.7)
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: 2.7
17+
bundler-cache: true
18+
- name: Build and test with RSpec
19+
run: |
20+
bundle exec rake test
21+
- name: Coveralls
22+
uses: coverallsapp/github-action@master
23+
with:
24+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
with:
2222
ruby-version: ${{ matrix.entry.ruby }}
2323
bundler-cache: true
24-
- run: bundle exec rake test
24+
- run: bundle exec rake test spinach
2525
continue-on-error: ${{ matrix.entry.allowed-failure || false }}

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### 1.0.2 (Next)
44

55
* [#268](https://github.com/codegram/hyperclient/pull/268): Replace Travis-CI with GHA - [@dblock](https://github.com/dblock).
6+
* [#269](https://github.com/codegram/hyperclient/pull/269): Re-add code coverage - [@dblock](https://github.com/dblock).
67
* Your contribution here.
78

89
### 1.0.1 (2021/01/02)

Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ group :development, :test do
1717
gem 'rake'
1818
gem 'rubocop', '0.81.0', require: false
1919
gem 'simplecov', require: false
20+
gem 'simplecov-lcov', require: false
2021
end
2122

2223
group :test do

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Hyperclient is a Hypermedia API client written in Ruby. It fully supports [JSON
99

1010
# Table of Contents
1111

12-
- [Hyperclient](#hyperclient)
13-
- [Table of Contents](#table-of-contents)
1412
- [Usage](#usage)
1513
- [API Client](#api-client)
1614
- [Resources and Attributes](#resources-and-attributes)

Rakefile

-8
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ Bundler.setup :default, :test, :development
66

77
Bundler::GemHelper.install_tasks
88

9-
if ENV['COVERAGE']
10-
require 'simplecov'
11-
SimpleCov.start do
12-
add_filter '/test/'
13-
add_filter '/features/'
14-
end
15-
end
16-
179
require 'rake/testtask'
1810

1911
Rake::TestTask.new(:test) do |t|

test/test_helper.rb

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
$LOAD_PATH << 'lib'
22

3+
if ENV['COVERAGE']
4+
require 'simplecov'
5+
require 'simplecov-lcov'
6+
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
7+
SimpleCov::Formatter::LcovFormatter.config do |c|
8+
c.report_with_single_file = true
9+
c.lcov_file_name = 'lcov.info'
10+
c.single_report_path = 'coverage/lcov.info'
11+
end
12+
SimpleCov.start do
13+
add_filter '/test/'
14+
add_filter '/features/'
15+
end
16+
end
17+
318
require 'minitest/autorun'
419
require 'minitest/pride'
520
require 'mocha/minitest'

0 commit comments

Comments
 (0)