Skip to content

Commit e28eee3

Browse files
authored
Merge pull request #65 from dblock/dblock/coveralls-github-token
Report coverage to Coveralls on pull requests using GITHUB_TOKEN
2 parents bff72aa + aabc2eb commit e28eee3

4 files changed

Lines changed: 19 additions & 6 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Coverage
33

4-
on: [push]
4+
on: [push, pull_request]
55

66
jobs:
77
build:
@@ -15,5 +15,8 @@ jobs:
1515
bundler-cache: true
1616
- name: Build and test with RSpec
1717
run: bundle exec rspec
18-
env:
19-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
18+
- name: Report coverage to Coveralls
19+
uses: coverallsapp/github-action@v2
20+
with:
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
path-to-lcov: coverage/lcov.info

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### 1.2.2 (Next)
22

3+
* [#65](https://github.com/dblock/ruby-enum/pull/65): Fixed coverage reporting to Coveralls not running on pull requests by switching from `coveralls_reborn`/`COVERALLS_REPO_TOKEN` to `coverallsapp/github-action`/`GITHUB_TOKEN` - [@dblock](https://github.com/dblock).
34
* Your contribution here.
45

56
### 1.2.1 (2026/08/15)

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ group :development, :test do
1818
end
1919

2020
group :test do
21-
gem 'coveralls_reborn', require: false
21+
gem 'simplecov'
22+
gem 'simplecov-lcov', require: false
2223
end

spec/spec_helper.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@
44

55
require 'rubygems'
66

7-
require 'coveralls'
8-
Coveralls.wear!
7+
require 'simplecov'
8+
require 'simplecov-lcov'
9+
10+
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
11+
SimpleCov::Formatter::LcovFormatter.config.single_report_path = 'coverage/lcov.info'
12+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
13+
SimpleCov::Formatter::HTMLFormatter,
14+
SimpleCov::Formatter::LcovFormatter
15+
])
16+
SimpleCov.start
917

1018
require 'rspec'
1119
require 'ruby-enum'

0 commit comments

Comments
 (0)