diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index e4822f3d7..3d6ffa0fd 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -47,6 +47,12 @@ jobs: env: RAILS_ENV: test working-directory: src/supermarket + - name: Simplecov Report + uses: aki77/simplecov-report-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + failedThreshold: 90 + resultPath: src/supermarket/coverage/.last_run.json fieri: runs-on: ubuntu-latest diff --git a/src/supermarket/Gemfile b/src/supermarket/Gemfile index f61b47086..c214ed0b4 100644 --- a/src/supermarket/Gemfile +++ b/src/supermarket/Gemfile @@ -80,6 +80,7 @@ group :test do gem "vcr", require: false gem "webmock", require: false gem "puma" + gem "simplecov", require: false end group :development, :test do diff --git a/src/supermarket/Gemfile.lock b/src/supermarket/Gemfile.lock index d8c4c232f..225ec509f 100644 --- a/src/supermarket/Gemfile.lock +++ b/src/supermarket/Gemfile.lock @@ -209,6 +209,7 @@ GEM descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) diff-lcs (1.3) + docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) dotenv (2.7.6) @@ -656,6 +657,12 @@ GEM sidekiq-cron (1.2.0) fugit (~> 1.1) sidekiq (>= 4.2.1) + simplecov (0.21.2) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.3) sitemap_generator (6.1.2) builder (~> 3.0) spring (2.1.1) @@ -846,6 +853,7 @@ DEPENDENCIES shoulda-matchers sidekiq (~> 4.2) sidekiq-cron + simplecov sitemap_generator spring spring-commands-rspec @@ -864,4 +872,4 @@ DEPENDENCIES yard BUNDLED WITH - 2.1.4 \ No newline at end of file + 2.1.4 diff --git a/src/supermarket/spec/spec_helper.rb b/src/supermarket/spec/spec_helper.rb index dabbb6e8d..429ad6cd4 100644 --- a/src/supermarket/spec/spec_helper.rb +++ b/src/supermarket/spec/spec_helper.rb @@ -9,6 +9,8 @@ require "capybara/poltergeist" require "capybara-screenshot/rspec" require "factory_bot_rails" +require "simplecov" +SimpleCov.start # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories.