-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Removed codecov (too buggy and useless for pagy) - Simplified and normalized the SimpleCov setup - Replaced coverage_summary task by check_coverage - Replaced the codecov CI step to check_coverage - Added coverage static badge
- Loading branch information
Showing
14 changed files
with
72 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,8 +45,6 @@ jobs: | |
- ruby-version: '3.3' | ||
env: | ||
BUNDLE_GEMFILE: .github/gemfiles/default | ||
CODECOV: true | ||
CHECK_MANIFEST: true | ||
# RUBYOPT: '--disable-error_highlight' | ||
fail-fast: false | ||
env: ${{ matrix.env }} | ||
|
@@ -60,21 +58,16 @@ jobs: | |
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | ||
|
||
- name: Run Ruby Tests | ||
- name: Check Tests | ||
run: bundle exec rake test | ||
|
||
- name: Run Rubocop | ||
run: bundle exec rubocop --format github | ||
- name: Check Coverage | ||
run: bundle exec rake check_coverage | ||
|
||
- name: Run Codecov | ||
if: ${{ env.CODECOV == 'true' }} | ||
uses: codecov/[email protected] | ||
with: | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
- name: Check Rubocop compliance | ||
run: bundle exec rubocop --format github | ||
|
||
- name: Check gem manifest | ||
if: ${{ env.CHECK_MANIFEST == 'true' }} | ||
run: bundle exec rake manifest:check | ||
|
||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.idea/runConfigurations/Test___Cov.xml → .idea/runConfigurations/Test___CovReport.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...unConfigurations/Test___Rubocop___Cov.xml → ...igurations/Test___Rubocop___CovReport.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
SimpleCov.formatter = if ENV['HTML_REPORTS'] == 'true' | ||
SimpleCov::Formatter::HTMLFormatter | ||
else | ||
SimpleCov::Formatter::SimpleFormatter | ||
end | ||
|
||
SimpleCov.start do | ||
command_name "Task##{$PROCESS_ID}" # best way to get a different id for the specific task | ||
merge_timeout 60 | ||
enable_coverage :branch | ||
|
||
add_group 'All Extras', %w[lib/pagy/extras] | ||
add_group 'Core', %w[lib/pagy.rb | ||
lib/pagy/backend.rb | ||
lib/pagy/console.rb | ||
lib/pagy/countless.rb | ||
lib/pagy/exceptions.rb | ||
lib/pagy/frontend.rb | ||
lib/pagy/i18n.rb | ||
lib/pagy/url_helpers.rb] | ||
add_group 'Countless', %w[lib/pagy/countless.rb | ||
lib/pagy/extras/countless.rb] | ||
add_group 'Calendar', %w[lib/pagy/extras/calendar.rb | ||
lib/pagy/calendar] | ||
# add_filter "/test/" | ||
add_group 'Tests', %w[test] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'json' | ||
|
||
# If you use the RubyMine coverage command to run the rake default (test), | ||
# RubyMine will run the coverage with its tools thus this task will be skipped. | ||
desc 'Display coverage summary. Fail if not 100%' | ||
task :check_coverage do | ||
return if ENV['RUBYMINE_SIMPLECOV_COVERAGE_PATH'] | ||
|
||
last_run = JSON.parse(File.read(File.expand_path('../coverage/.last_run.json', __dir__))) | ||
line = last_run['result']['line'] | ||
branch = last_run['result']['branch'] | ||
message = "\n>>> Coverage -> line: #{line}% -> branch: #{branch}%\n" | ||
message << ">>> Missing #{(100.0 - line).round(2)}% of line coverage!\n" if line < 100 | ||
message << ">>> Missing #{(100.0 - branch).round(2)}% of branch coverage!\n" if branch < 100 | ||
if line < 100 || branch < 100 | ||
message << ">>> Run the task again with HTML_REPORTS=true for a line-by-line HTML report @ coverage/index.html\n" \ | ||
unless ENV['HTML_REPORTS'] | ||
warn message | ||
exit 1 | ||
else | ||
puts message | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters