Skip to content

Commit

Permalink
Integrated test coverage % report (#202)
Browse files Browse the repository at this point in the history
Signed-off-by: snehaldwivedi <sdwivedi@msystechnologies.com>
  • Loading branch information
snehaldwivedi committed Jan 17, 2022
1 parent 1461c85 commit 30baa3f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This is a basic workflow to help you get started with Action
name: CI

# Controls when the workflow will run
on:
push:
branches: main
pull_request:
branches: main

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
coverage-test:
name: Coverage
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: run specs
run: bundle exec rake spec --trace
- name: Simplecov Report
uses: aki77/simplecov-report-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
failedThreshold: 90
resultPath: coverage/.last_run.json
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ group :test do
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7")
gem "ohai", "~> 16"
end

gem "simplecov", require: false
end

group :development do
Expand Down
5 changes: 5 additions & 0 deletions coverage/.last_run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"result": {
"line": 98.51
}
}
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
require "chef/config"

require "chef-cli/cli"
require "simplecov"
SimpleCov.start

RSpec.configure do |c|
running_on_windows = (RUBY_PLATFORM =~ /mswin|mingw|windows/)
Expand Down

0 comments on commit 30baa3f

Please sign in to comment.