Skip to content

Commit

Permalink
build: enable simplecov to mensure specs coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dvinciguerra committed May 30, 2023
1 parent 5713c43 commit f859dee
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ on:
pull_request:

jobs:
build:
test:
runs-on: ubuntu-latest
name: Ruby ${{ matrix.ruby }}
strategy:
matrix:
ruby:
- '3.2.1'
- '3.1.0'
- '3.0.0'
- '2.7.0'

steps:
- uses: actions/checkout@v2
Expand All @@ -23,8 +26,10 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run the default task

- name: Run Specs
run: bundle exec rake

- name: Create Coverage Artifact
uses: actions/upload-artifact@v2
with:
Expand Down
9 changes: 4 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.0'

group :development do
gem "guard-rspec", "~> 4.7"
gem "rubocop", "~> 1.51"
gem "rubocop-rspec", "~> 2.22"
gem 'guard-rspec', '~> 4.7'
gem 'rubocop', '~> 1.51'
gem 'rubocop-rspec', '~> 2.22'
end

group :test do
gem "simplecov", "~> 0.22.0", require: false
gem 'simplecov', '~> 0.22.0', require: false
end

8 changes: 8 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

require 'u-menu'

require 'simplecov'
require 'securerandom'

SimpleCov.start

SimpleCov.at_exit do
puts 'Coverage done'
SimpleCov.result.format!
end

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = '.rspec_status'
Expand Down

0 comments on commit f859dee

Please sign in to comment.