Skip to content

Commit 5303a22

Browse files
committed
ci: updates workflow to include simplecov check
1 parent 1001e13 commit 5303a22

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

.github/workflows/main.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,25 @@ jobs:
1515
- '4.0.0'
1616
steps:
1717
- uses: actions/checkout@v4
18+
name: Checkout code
19+
1820
- name: Set up Ruby
1921
uses: ruby/setup-ruby@v1
2022
with:
2123
ruby-version: ${{ matrix.ruby }}
22-
bundler-cache: false
24+
bundler-cache: true
25+
2326
- name: Install dependencies
2427
run: bundle install --jobs 4 --retry 3
25-
- name: Run the default task
28+
29+
- name: Run the default rake task
2630
run: bundle exec rake
31+
env:
32+
COVERAGE: "true"
33+
34+
- name: Check SimpleCov coverage
35+
uses: joshmfrankel/simplecov-check-action@main
36+
with:
37+
minimum_suite_coverage: 97
38+
minimum_file_coverage: 90
39+
github_token: ${{ secrets.GITHUB_TOKEN }}

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ gem 'rubocop-performance'
1515
gem 'rubocop-rake'
1616
gem 'shoulda-context'
1717
gem 'simplecov'
18+
gem 'simplecov-json'

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ GEM
142142
simplecov-html (~> 0.11)
143143
simplecov_json_formatter (~> 0.1)
144144
simplecov-html (0.13.2)
145+
simplecov-json (0.2.3)
146+
json
147+
simplecov
145148
simplecov_json_formatter (0.1.4)
146149
trailblazer (2.1.3)
147150
trailblazer-activity-dsl-linear (>= 1.2.3, < 1.3.0)
@@ -197,6 +200,7 @@ DEPENDENCIES
197200
rubocop-rake
198201
shoulda-context
199202
simplecov
203+
simplecov-json
200204

201205
CHECKSUMS
202206
addressable (2.8.8) sha256=7c13b8f9536cf6364c03b9d417c19986019e28f7c00ac8132da4eb0fe393b057
@@ -255,6 +259,7 @@ CHECKSUMS
255259
shoulda-context (2.0.0) sha256=7adf45342cd800f507d2a053658cb1cce2884b616b26004d39684b912ea32c34
256260
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
257261
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
262+
simplecov-json (0.2.3) sha256=c63823b5dfc95c85ff4cb94251765f08a166bdd68098f259368cbfe738e281f7
258263
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
259264
trailblazer (2.1.3) sha256=8adf157f552a4843de51456f7e70e28422799e5d060b265814d145774b8845b7
260265
trailblazer-activity (0.17.0) sha256=2166bc8b3410b808ad2bfe00efaf559533d1b9a6fb0d704cf3bdad02cd6c0b88

test/helper.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
if ENV['COVERAGE']
44
require 'simplecov'
5+
require 'simplecov-json'
6+
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
7+
[
8+
SimpleCov::Formatter::HTMLFormatter,
9+
SimpleCov::Formatter::JSONFormatter
10+
]
11+
)
512
SimpleCov.start do
613
enable_coverage :branch
714
add_filter '/test/'

0 commit comments

Comments
 (0)