Skip to content

Commit 0223dfd

Browse files
committed
Update CI for coveralls.
1 parent da411f1 commit 0223dfd

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616
env:
1717
CI: true
18+
ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') }}
1819
strategy:
1920
fail-fast: false
2021
matrix:
2122
ruby:
22-
- 2.4
2323
- 2.5
2424
- 2.6
2525
- 2.7
@@ -35,5 +35,9 @@ jobs:
3535
- name: Install dependencies
3636
run: bundle install --jobs 4 --retry 3
3737
- name: Run tests
38-
run: bundle exec rspec spec
39-
38+
run: bundle exec rspec spec || $ALLOW_FAILURES
39+
- name: Coveralls GitHub Action
40+
uses: coverallsapp/github-action@v1.1.2
41+
if: "matrix.ruby == '3.0'"
42+
with:
43+
github-token: ${{ secrets.GITHUB_TOKEN }}

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ source "https://rubygems.org"
22
gemspec
33

44
group :development, :test do
5-
gem 'simplecov', platforms: :mri
6-
gem 'coveralls', '~> 0.8', platforms: :mri
5+
gem 'simplecov', '~> 0.21', platforms: :mri
6+
gem 'simplecov-lcov', '~> 0.8', platforms: :mri
77
gem 'benchmark-ips'
88
gem 'rake'
99
end

spec/spec_helper.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@
55

66
begin
77
require 'simplecov'
8-
require 'coveralls' unless ENV['NOCOVERALLS']
8+
require 'simplecov-lcov'
9+
10+
SimpleCov::Formatter::LcovFormatter.config do |config|
11+
#Coveralls is coverage by default/lcov. Send info results
12+
config.report_with_single_file = true
13+
config.single_report_path = 'coverage/lcov.info'
14+
end
15+
916
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
1017
SimpleCov::Formatter::HTMLFormatter,
11-
(Coveralls::SimpleCov::Formatter unless ENV['NOCOVERALLS'])
18+
SimpleCov::Formatter::LcovFormatter
1219
])
1320
SimpleCov.start do
1421
add_filter "/spec/"

0 commit comments

Comments
 (0)