Skip to content

Commit

Permalink
Re-add code coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Feb 16, 2023
1 parent 2270002 commit 803ded0
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 11 deletions.
Binary file added .DS_Store
Binary file not shown.
24 changes: 24 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: coverage
on: [push, pull_request]

env:
COVERAGE: 1

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Ruby (2.7)
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Build and test with RSpec
run: |
bundle exec rake test
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
with:
ruby-version: ${{ matrix.entry.ruby }}
bundler-cache: true
- run: bundle exec rake test
- run: bundle exec rake test spinach
continue-on-error: ${{ matrix.entry.allowed-failure || false }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### 1.0.2 (Next)

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

### 1.0.1 (2021/01/02)
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ group :development, :test do
gem 'rake'
gem 'rubocop', '0.81.0', require: false
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false
end

group :test do
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Hyperclient is a Hypermedia API client written in Ruby. It fully supports [JSON

# Table of Contents

- [Hyperclient](#hyperclient)
- [Table of Contents](#table-of-contents)
- [Usage](#usage)
- [API Client](#api-client)
- [Resources and Attributes](#resources-and-attributes)
Expand Down
8 changes: 0 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ Bundler.setup :default, :test, :development

Bundler::GemHelper.install_tasks

if ENV['COVERAGE']
require 'simplecov'
SimpleCov.start do
add_filter '/test/'
add_filter '/features/'
end
end

require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
Expand Down
15 changes: 15 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
$LOAD_PATH << 'lib'

if ENV['COVERAGE']
require 'simplecov'
require 'simplecov-lcov'
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.lcov_file_name = 'lcov.info'
c.single_report_path = 'coverage/lcov.info'
end
SimpleCov.start do
add_filter '/test/'
add_filter '/features/'
end
end

require 'minitest/autorun'
require 'minitest/pride'
require 'mocha/minitest'
Expand Down

0 comments on commit 803ded0

Please sign in to comment.