diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ea10b9c..1e5595e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,7 +1,7 @@ --- name: Coverage -on: [push] +on: [push, pull_request] jobs: build: @@ -15,5 +15,8 @@ jobs: bundler-cache: true - name: Build and test with RSpec run: bundle exec rspec - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + - name: Report coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: coverage/lcov.info diff --git a/CHANGELOG.md b/CHANGELOG.md index 8111ee8..eb5202b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### 1.2.2 (Next) +* [#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). * Your contribution here. ### 1.2.1 (2026/08/15) diff --git a/Gemfile b/Gemfile index 3ce44a3..82808f4 100644 --- a/Gemfile +++ b/Gemfile @@ -18,5 +18,6 @@ group :development, :test do end group :test do - gem 'coveralls_reborn', require: false + gem 'simplecov' + gem 'simplecov-lcov', require: false end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bdc51a2..8c82783 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,8 +4,16 @@ require 'rubygems' -require 'coveralls' -Coveralls.wear! +require 'simplecov' +require 'simplecov-lcov' + +SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true +SimpleCov::Formatter::LcovFormatter.config.single_report_path = 'coverage/lcov.info' +SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::HTMLFormatter, + SimpleCov::Formatter::LcovFormatter + ]) +SimpleCov.start require 'rspec' require 'ruby-enum'