Skip to content

Commit 93ec1aa

Browse files
authored
Coverage (#72)
* Coverage * Update ci.yml * Update ci.yml * Update Gemfile * Update test_helper.rb * Format * Update README.md
1 parent 3796c81 commit 93ec1aa

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,15 @@ jobs:
3131
ruby-version: ${{ matrix.ruby }}
3232
bundler-cache: true
3333
- run: bundle exec standardrb
34-
- run: COVERAGE=0 TEST_NODE_PARITY=1 bundle exec rake test
34+
- name: Run tests with coverage
35+
env:
36+
COVERAGE: 1
37+
TEST_NODE_PARITY: 1
38+
run: bundle exec rake test
39+
- name: Upload coverage to Codecov
40+
if: matrix.ruby == 3.3
41+
uses: codecov/codecov-action@v5
42+
with:
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
files: ./coverage/coverage.json
45+
fail_ci_if_error: true

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
source "https://rubygems.org"
22

3+
gem "rake"
4+
gem "minitest"
5+
gem "simplecov"
6+
gem "simplecov-cobertura"
7+
38
gemspec

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![Build Status](https://github.com/transloadit/ruby-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/transloadit/ruby-sdk/actions/workflows/ci.yml)
2-
[![Code Climate](https://codeclimate.com/github/transloadit/ruby-sdk.png)](https://codeclimate.com/github/transloadit/ruby-sdk)
2+
[![Coverage](https://codecov.io/gh/transloadit/ruby-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/transloadit/ruby-sdk)
33

44
# Transloadit Ruby SDK
55

test/test_helper.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33

44
if ENV["COVERAGE"] != "0"
55
require "simplecov"
6-
SimpleCov.start { add_filter "/test/" }
6+
SimpleCov.start do
7+
add_filter "/test/"
8+
enable_coverage :branch
9+
end
10+
11+
require "simplecov-cobertura"
12+
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
713
end
814

915
require "minitest/autorun"

0 commit comments

Comments
 (0)