Skip to content

Commit 7c02f9f

Browse files
committed
ci: upload coverage to Codecov
1 parent 152f91c commit 7c02f9f

5 files changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ jobs:
6161
- name: RSpec
6262
run: bundle exec rake spec
6363

64+
# SimpleCov emits coverage/lcov.info for Codecov. Upload from the latest
65+
# Ruby matrix entry only; coverage should not differ by patch runtime.
66+
- name: Upload coverage to Codecov
67+
if: matrix.ruby == '3.5'
68+
# codecov/codecov-action v6.0.1
69+
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
70+
with:
71+
fail_ci_if_error: false
72+
flags: unittests
73+
files: ./coverage/lcov.info
74+
token: ${{ secrets.CODECOV_TOKEN }}
75+
6476
- name: Upload test artifacts
6577
if: failure()
6678
# actions/upload-artifact v4.4.3

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ group :development, :test do
1616
gem 'rubocop-rake', require: false
1717
gem 'rubocop-rspec', require: false
1818
gem 'simplecov', '~> 0.22', require: false
19+
gem 'simplecov-lcov', '~> 0.8', require: false
1920
gem 'steep', '~> 2.0', require: false
2021
gem 'yard', '~> 0.9', require: false
2122
end

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ GEM
167167
simplecov-html (~> 0.11)
168168
simplecov_json_formatter (~> 0.1)
169169
simplecov-html (0.13.2)
170+
simplecov-lcov (0.9.0)
170171
simplecov_json_formatter (0.1.4)
171172
sqlite3 (2.9.4)
172173
mini_portile2 (~> 2.8.0)
@@ -234,6 +235,7 @@ DEPENDENCIES
234235
rubocop-rake
235236
rubocop-rspec
236237
simplecov (~> 0.22)
238+
simplecov-lcov (~> 0.8)
237239
steep (~> 2.0)
238240
yard (~> 0.9)
239241

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<p align="center">
66
<a href="https://rubygems.org/gems/arcp"><img alt="gem" src="https://img.shields.io/gem/v/arcp.svg"></a>
77
<a href="https://github.com/agentruntimecontrolprotocol/ruby-sdk/actions/workflows/test.yml"><img alt="CI" src="https://github.com/agentruntimecontrolprotocol/ruby-sdk/actions/workflows/test.yml/badge.svg"></a>
8+
<a href="https://codecov.io/gh/agentruntimecontrolprotocol/ruby-sdk"><img alt="codecov" src="https://codecov.io/gh/agentruntimecontrolprotocol/ruby-sdk/graph/badge.svg"></a>
89
<a href="https://github.com/agentruntimecontrolprotocol/spec/blob/main/docs/draft-arcp-1.1.md"><img alt="ARCP" src="https://img.shields.io/badge/ARCP-v1.1%20draft-blue"></a>
910
<a href="LICENSE"><img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-lightgrey"></a>
1011
<a href="https://coderabbit.ai"><img alt="CodeRabbit" src="https://img.shields.io/coderabbit/prs/github/agentruntimecontrolprotocol/ruby-sdk?utm_source=oss&utm_medium=github&utm_campaign=agentruntimecontrolprotocol/ruby-sdk&labelColor=171717&color=FF570A&label=CodeRabbit+Reviews"></a>

spec/spec_helper.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# frozen_string_literal: true
22

33
require 'simplecov'
4+
require 'simplecov-lcov'
5+
6+
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
7+
SimpleCov::Formatter::LcovFormatter.config.single_report_path = 'coverage/lcov.info'
8+
SimpleCov.formatters = [
9+
SimpleCov::Formatter::HTMLFormatter,
10+
SimpleCov::Formatter::LcovFormatter
11+
]
12+
413
SimpleCov.start do
514
enable_coverage :branch
615
add_filter '/spec/'

0 commit comments

Comments
 (0)