Skip to content

Commit 4f91894

Browse files
committed
Merge coverage results
parser and prism will differ in what they do, so merge them together. jruby doesn't seem to support coverage (maybe jruby bug?): > KeyError: key not found: :branch
1 parent c7a5392 commit 4f91894

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

.github/workflows/main.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,33 @@ jobs:
4747
with:
4848
ruby-version: "${{ matrix.ruby }}"
4949
bundler-cache: true
50-
- run: NO_COVERAGE=true bundle exec rake spec
50+
- run: bundle exec rake spec
5151
env:
5252
PARSER_ENGINE: ${{ matrix.parser_engine }}
53+
- name: Upload Coverage Artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: coverage-ubuntu-${{ matrix.ruby }}-${{ matrix.parser_engine }}
57+
path: coverage/.resultset.json
58+
include-hidden-files: true
5359

5460
coverage:
61+
name: Check Coverage
62+
needs: main
5563
runs-on: ubuntu-latest
56-
name: "Test coverage"
64+
5765
steps:
5866
- uses: actions/checkout@v4
67+
- uses: actions/download-artifact@v4
68+
name: Download Coverage Artifacts
69+
with:
70+
pattern: coverage-*
5971
- uses: ruby/setup-ruby@v1
6072
with:
61-
ruby-version: "3.4"
73+
ruby-version: ruby # Latest stable CRuby version
6274
bundler-cache: true
63-
- run: bundle exec rake spec
75+
76+
- run: bundle exec rake coverage:ci
6477

6578
edge-rubocop:
6679
runs-on: ubuntu-latest

spec/spec_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'rubocop'
44
require 'rubocop/rspec/support'
55

6-
require 'simplecov' unless ENV['NO_COVERAGE']
6+
require 'simplecov' unless ENV['NO_COVERAGE'] || RUBY_ENGINE == 'jruby'
77

88
module SpecHelper
99
ROOT = Pathname.new(__dir__).parent.freeze

tasks/coverage.rake

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
namespace :coverage do
4+
desc 'Report Coverage from merged CI runs'
5+
task :ci do
6+
require 'simplecov'
7+
8+
SimpleCov.collate Dir['coverage-*/.resultset.json']
9+
end
10+
end

0 commit comments

Comments
 (0)