Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeCov Integration #1155

Merged
merged 4 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
codecov:
token: 7dac3daa-47d7-4128-b35c-3889e6d9006b
coverage:
status:
project: #add everything under here, more options at https://docs.codecov.com/docs/commit-status
default:
# basic
target: auto #default
threshold: 0%
base: auto
comment: #this is a top-level key
layout: " diff, flags, files"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: false # [true :: must have a base report to post]
require_head: true # [true :: must have a head report to post]
hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage]
10 changes: 4 additions & 6 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,11 @@ jobs:
mkdir /tmp/test-results
bundle exec rspec --backtrace --format progress --format RspecJunitFormatter --out /tmp/test-results/rspec.xml
-
name: Publish UndercoverCI report
name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
continue-on-error: true
run: |
ruby -e "$(curl -s https://undercover-ci.com/uploader.rb)" -- \
--repo ${{ github.repository }} \
--commit ${{ github.event.pull_request.head.sha || github.sha }} \
--lcov coverage/lcov/spot.lcov
with:
token: ${{ secrets.CODECOV_TOKEN }}
-
name: Publish RSpec report
uses: mikepenz/action-junit-report@v3
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ group :development, :test do
gem 'selenium-webdriver'
gem 'shoulda-matchers', '~> 4'
gem 'simplecov', '~> 0.21.2', require: false
gem "simplecov-lcov", "~> 0.8.0", require: false
gem 'simplecov-cobertura', '~> 2.1', require: false
gem 'stub_env', '~> 1.0.4'
gem 'webmock', '~> 3.8'
end
6 changes: 4 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -975,8 +975,10 @@ GEM
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
slack-ruby-client (0.14.6)
activesupport
Expand Down Expand Up @@ -1143,7 +1145,7 @@ DEPENDENCIES
sidekiq-cron (~> 1.9.1)
simple_form (< 5.2)
simplecov (~> 0.21.2)
simplecov-lcov (~> 0.8.0)
simplecov-cobertura (~> 2.1)
slack-ruby-client (~> 0.14.6)
spring (~> 2.1.1)
spring-watcher-listen (~> 2.0.0)
Expand Down
9 changes: 3 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
if ENV['COVERAGE'] || ENV['CI']
ENV['DISABLE_BOOTSNAP'] = 'true'

# set up code-coverage; we use LCOV formatting to send to undercover-ci.
# @see https://undercover-ci.com/app
# set up code-coverage
require 'simplecov'
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
SimpleCov.start 'rails' do
add_filter 'lib/mailer_previews'
enable_coverage(:branch)
end
end

Expand Down
Loading