🔧 Readd checking code coverage with Coveralls

This commit is contained in:
yoshoku 2021-01-17 00:31:04 +09:00
parent 8131c94c8b
commit bf804cb5f3
4 changed files with 41 additions and 3 deletions

1
.coveralls.yml Normal file
View File

@ -0,0 +1 @@
service_name: github-ci

28
.github/workflows/coverage.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
coverage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install BLAS and LAPACK
run: sudo apt-get install -y libopenblas-dev liblapacke-dev
- name: Set up Ruby 2.7
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Build and test with Rake
run: |
gem install bundler
bundle install
bundle exec rake
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -13,4 +13,5 @@ gem 'rubocop', '~> 1.0'
gem 'rubocop-performance', '~> 1.8'
gem 'rubocop-rake', '~> 0.5'
gem 'rubocop-rspec', '~> 2.0'
gem 'simplecov', '~> 0.19'
gem 'simplecov', '~> 0.21'
gem 'simplecov-lcov', '~> 0.8'

View File

@ -1,9 +1,17 @@
# frozen_string_literal: true
require 'pp'
require 'simplecov'
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config do |config|
config.report_with_single_file = true
config.single_report_path = 'coverage/lcov.info'
end
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
[SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::LcovFormatter]
)
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([SimpleCov::Formatter::HTMLFormatter])
SimpleCov.start
require 'bundler/setup'