Skip to content

Commit c14de1a

Browse files
committed
Update CI for coveralls.
1 parent 228202f commit c14de1a

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
env:
1717
CI: true
18+
ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'jruby' }}
1819
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
1920
strategy:
2021
fail-fast: false
@@ -26,7 +27,7 @@ jobs:
2627
- 2.7
2728
- 3.0
2829
- ruby-head
29-
#- jruby # No Nokogumbo on JRuby
30+
- jruby
3031
gemfile:
3132
- Gemfile
3233
- Gemfile-pure
@@ -40,5 +41,9 @@ jobs:
4041
- name: Install dependencies
4142
run: bundle install --jobs 4 --retry 3
4243
- name: Run tests
43-
run: bundle exec rspec spec
44-
44+
run: bundle exec rspec spec || $ALLOW_FAILURES
45+
- name: Coveralls GitHub Action
46+
uses: coverallsapp/github-action@v1.1.2
47+
if: ${{ matrix.ruby == '3.0' && matrix.gemfile == 'Gemfile' }}
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ group :debug do
2525
end
2626

2727
group :test do
28-
gem 'simplecov', '~> 0.16', platforms: :mri
29-
gem 'coveralls', '~> 0.8', platforms: :mri
28+
gem 'simplecov', '~> 0.21', platforms: :mri
29+
gem 'simplecov-lcov', '~> 0.8', platforms: :mri
3030
end

spec/spec_helper.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@
1616
end
1717
begin
1818
require 'simplecov'
19-
require 'coveralls'
19+
require 'simplecov-lcov'
20+
SimpleCov::Formatter::LcovFormatter.config do |config|
21+
#Coveralls is coverage by default/lcov. Send info results
22+
config.report_with_single_file = true
23+
config.single_report_path = 'coverage/lcov.info'
24+
end
25+
2026
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
2127
SimpleCov::Formatter::HTMLFormatter,
22-
Coveralls::SimpleCov::Formatter
28+
SimpleCov::Formatter::LcovFormatter
2329
])
2430
SimpleCov.start do
2531
add_filter "/spec/"

0 commit comments

Comments
 (0)