Skip to content

Commit 68ed33f

Browse files
Copilotkwerle
andcommitted
Add coverage reporting with Codecov integration and badge
Co-authored-by: kwerle <23320+kwerle@users.noreply.github.com>
1 parent 5be6485 commit 68ed33f

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,11 @@ jobs:
2020
- uses: actions/checkout@v2
2121
- name: Run tests
2222
run: make test
23+
- name: Run tests with coverage
24+
run: make coverage
25+
- name: Upload coverage to Codecov
26+
uses: codecov/codecov-action@v4
27+
with:
28+
files: ./coverage/coverage.json
29+
fail_ci_if_error: false
30+
token: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
![Build Status](https://github.com/kwerle/ruby_language_server/actions/workflows/test.yml/badge.svg)
2+
[![codecov](https://codecov.io/gh/kwerle/ruby_language_server/branch/master/graph/badge.svg)](https://codecov.io/gh/kwerle/ruby_language_server)
23
# Overview
34

45
https://github.com/kwerle/ruby_language_server

spec/test_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
if ENV['COVERAGE']
44
require 'simplecov'
5+
require 'simplecov_json_formatter'
56
SimpleCov.start do
67
add_filter '/spec/'
78
add_filter '/vendor/'
9+
# Use JSON formatter for CI/Codecov integration
10+
formatter SimpleCov::Formatter::JSONFormatter if ENV['CI']
811
end
912
end
1013

0 commit comments

Comments
 (0)