Merge pull request #7828 from MikeMcQuaid/codecov
Use CodeCov for coverage reporting.
This commit is contained in:
commit
9c4c6e7ae9
3
.github/workflows/tests.yml
vendored
3
.github/workflows/tests.yml
vendored
@ -139,8 +139,7 @@ jobs:
|
|||||||
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# set variables for coverage reporting
|
# set variables for coverage reporting
|
||||||
HOMEBREW_CI_NAME: github-actions
|
HOMEBREW_CODECOV_TOKEN: 3ea0364c-80ce-47a3-9fba-93a940d4b5d7
|
||||||
HOMEBREW_COVERALLS_REPO_TOKEN: 3F6U6ZqctoNJwKyREremsqMgpU3qYgxFk
|
|
||||||
|
|
||||||
# These cannot be queried at the macOS level on GitHub Actions.
|
# These cannot be queried at the macOS level on GitHub Actions.
|
||||||
HOMEBREW_LANGUAGES: en-GB
|
HOMEBREW_LANGUAGES: en-GB
|
||||||
|
|||||||
7
.gitignore
vendored
7
.gitignore
vendored
@ -86,7 +86,7 @@
|
|||||||
**/vendor/bundle/ruby/*/gems/byebug-*/
|
**/vendor/bundle/ruby/*/gems/byebug-*/
|
||||||
**/vendor/bundle/ruby/*/gems/coderay-*/
|
**/vendor/bundle/ruby/*/gems/coderay-*/
|
||||||
**/vendor/bundle/ruby/*/gems/connection_pool-*/
|
**/vendor/bundle/ruby/*/gems/connection_pool-*/
|
||||||
**/vendor/bundle/ruby/*/gems/coveralls-*/
|
**/vendor/bundle/ruby/*/gems/codecov-*/
|
||||||
**/vendor/bundle/ruby/*/gems/diff-lcs-*/
|
**/vendor/bundle/ruby/*/gems/diff-lcs-*/
|
||||||
**/vendor/bundle/ruby/*/gems/docile-*/
|
**/vendor/bundle/ruby/*/gems/docile-*/
|
||||||
**/vendor/bundle/ruby/*/gems/domain_name-*/
|
**/vendor/bundle/ruby/*/gems/domain_name-*/
|
||||||
@ -127,11 +127,8 @@
|
|||||||
**/vendor/bundle/ruby/*/gems/ruby-prof-*/
|
**/vendor/bundle/ruby/*/gems/ruby-prof-*/
|
||||||
**/vendor/bundle/ruby/*/gems/ruby-progressbar-*/
|
**/vendor/bundle/ruby/*/gems/ruby-progressbar-*/
|
||||||
**/vendor/bundle/ruby/*/gems/simplecov-*/
|
**/vendor/bundle/ruby/*/gems/simplecov-*/
|
||||||
**/vendor/bundle/ruby/*/gems/simplecov-cobertura-*/
|
|
||||||
**/vendor/bundle/ruby/*/gems/simplecov-html-*/
|
**/vendor/bundle/ruby/*/gems/simplecov-html-*/
|
||||||
**/vendor/bundle/ruby/*/gems/term-ansicolor-*/
|
**/vendor/bundle/ruby/*/gems/url-*/
|
||||||
**/vendor/bundle/ruby/*/gems/thor-*/
|
|
||||||
**/vendor/bundle/ruby/*/gems/tins-*/
|
|
||||||
**/vendor/bundle/ruby/*/gems/unf_ext-*/
|
**/vendor/bundle/ruby/*/gems/unf_ext-*/
|
||||||
**/vendor/bundle/ruby/*/gems/unf-*/
|
**/vendor/bundle/ruby/*/gems/unf-*/
|
||||||
**/vendor/bundle/ruby/*/gems/unicode-display_width-*/
|
**/vendor/bundle/ruby/*/gems/unicode-display_width-*/
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "English"
|
require "English"
|
||||||
|
|
||||||
@ -20,7 +21,8 @@ SimpleCov.start do
|
|||||||
|
|
||||||
# Just save result, but don't write formatted output.
|
# Just save result, but don't write formatted output.
|
||||||
coverage_result = Coverage.result
|
coverage_result = Coverage.result
|
||||||
SimpleCov.add_not_loaded_files(coverage_result)
|
# TODO: this method is private, find a better way.
|
||||||
|
SimpleCov.send(:add_not_loaded_files, coverage_result)
|
||||||
simplecov_result = SimpleCov::Result.new(coverage_result)
|
simplecov_result = SimpleCov::Result.new(coverage_result)
|
||||||
SimpleCov::ResultMerger.store_result(simplecov_result)
|
SimpleCov::ResultMerger.store_result(simplecov_result)
|
||||||
|
|
||||||
@ -50,8 +52,8 @@ SimpleCov.start do
|
|||||||
|
|
||||||
require "rbconfig"
|
require "rbconfig"
|
||||||
host_os = RbConfig::CONFIG["host_os"]
|
host_os = RbConfig::CONFIG["host_os"]
|
||||||
add_filter %r{/os/mac} if host_os !~ /darwin/
|
add_filter %r{/os/mac} unless /darwin/.match?(host_os)
|
||||||
add_filter %r{/os/linux} if host_os !~ /linux/
|
add_filter %r{/os/linux} unless /linux/.match?(host_os)
|
||||||
|
|
||||||
# Add groups and the proper project name to the output.
|
# Add groups and the proper project name to the output.
|
||||||
project_name "Homebrew"
|
project_name "Homebrew"
|
||||||
|
|||||||
@ -4,7 +4,7 @@ source "https://rubygems.org"
|
|||||||
|
|
||||||
# installed gems
|
# installed gems
|
||||||
gem "byebug"
|
gem "byebug"
|
||||||
gem "coveralls", "~> 0.8", require: false
|
gem "codecov", require: false
|
||||||
gem "parallel_tests"
|
gem "parallel_tests"
|
||||||
gem "ronn", require: false
|
gem "ronn", require: false
|
||||||
gem "rspec"
|
gem "rspec"
|
||||||
|
|||||||
@ -9,14 +9,12 @@ GEM
|
|||||||
zeitwerk (~> 2.2, >= 2.2.2)
|
zeitwerk (~> 2.2, >= 2.2.2)
|
||||||
ast (2.4.1)
|
ast (2.4.1)
|
||||||
byebug (11.1.3)
|
byebug (11.1.3)
|
||||||
|
codecov (0.1.17)
|
||||||
|
json
|
||||||
|
simplecov
|
||||||
|
url
|
||||||
concurrent-ruby (1.1.6)
|
concurrent-ruby (1.1.6)
|
||||||
connection_pool (2.2.3)
|
connection_pool (2.2.3)
|
||||||
coveralls (0.8.23)
|
|
||||||
json (>= 1.8, < 3)
|
|
||||||
simplecov (~> 0.16.1)
|
|
||||||
term-ansicolor (~> 1.3)
|
|
||||||
thor (>= 0.19.4, < 2.0)
|
|
||||||
tins (~> 1.6)
|
|
||||||
diff-lcs (1.4.4)
|
diff-lcs (1.4.4)
|
||||||
docile (1.3.2)
|
docile (1.3.2)
|
||||||
domain_name (0.5.20190701)
|
domain_name (0.5.20190701)
|
||||||
@ -99,24 +97,18 @@ GEM
|
|||||||
rubocop (>= 0.68.1)
|
rubocop (>= 0.68.1)
|
||||||
ruby-macho (2.2.0)
|
ruby-macho (2.2.0)
|
||||||
ruby-progressbar (1.10.1)
|
ruby-progressbar (1.10.1)
|
||||||
simplecov (0.16.1)
|
simplecov (0.18.5)
|
||||||
docile (~> 1.1)
|
docile (~> 1.1)
|
||||||
json (>= 1.8, < 3)
|
simplecov-html (~> 0.11)
|
||||||
simplecov-html (~> 0.10.0)
|
simplecov-html (0.12.2)
|
||||||
simplecov-html (0.10.2)
|
|
||||||
sync (0.5.0)
|
|
||||||
term-ansicolor (1.7.1)
|
|
||||||
tins (~> 1.0)
|
|
||||||
thor (1.0.1)
|
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
tins (1.25.0)
|
|
||||||
sync
|
|
||||||
tzinfo (1.2.7)
|
tzinfo (1.2.7)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.7.7)
|
unf_ext (0.0.7.7)
|
||||||
unicode-display_width (1.7.0)
|
unicode-display_width (1.7.0)
|
||||||
|
url (0.3.2)
|
||||||
webrobots (0.1.2)
|
webrobots (0.1.2)
|
||||||
zeitwerk (2.3.1)
|
zeitwerk (2.3.1)
|
||||||
|
|
||||||
@ -126,8 +118,8 @@ PLATFORMS
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
activesupport
|
activesupport
|
||||||
byebug
|
byebug
|
||||||
|
codecov
|
||||||
concurrent-ruby
|
concurrent-ruby
|
||||||
coveralls (~> 0.8)
|
|
||||||
mechanize
|
mechanize
|
||||||
parallel_tests
|
parallel_tests
|
||||||
plist
|
plist
|
||||||
@ -143,4 +135,4 @@ DEPENDENCIES
|
|||||||
simplecov
|
simplecov
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.17.2
|
1.17.3
|
||||||
|
|||||||
@ -4,12 +4,10 @@ if ENV["HOMEBREW_TESTS_COVERAGE"]
|
|||||||
require "simplecov"
|
require "simplecov"
|
||||||
|
|
||||||
formatters = [SimpleCov::Formatter::HTMLFormatter]
|
formatters = [SimpleCov::Formatter::HTMLFormatter]
|
||||||
if ENV["HOMEBREW_COVERALLS_REPO_TOKEN"] && RUBY_PLATFORM[/darwin/]
|
if ENV["HOMEBREW_CODECOV_TOKEN"] && RUBY_PLATFORM[/darwin/]
|
||||||
require "coveralls"
|
require "codecov"
|
||||||
|
|
||||||
Coveralls::Output.no_color if !ENV["HOMEBREW_COLOR"] && (ENV["HOMEBREW_NO_COLOR"] || !$stdout.tty?)
|
formatters << SimpleCov::Formatter::Codecov
|
||||||
|
|
||||||
formatters << Coveralls::SimpleCov::Formatter
|
|
||||||
|
|
||||||
if ENV["TEST_ENV_NUMBER"]
|
if ENV["TEST_ENV_NUMBER"]
|
||||||
SimpleCov.at_exit do
|
SimpleCov.at_exit do
|
||||||
@ -18,16 +16,7 @@ if ENV["HOMEBREW_TESTS_COVERAGE"]
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ENV["CI_NAME"] = ENV["HOMEBREW_CI_NAME"]
|
ENV["CODECOV_TOKEN"] = ENV["HOMEBREW_CODECOV_TOKEN"]
|
||||||
ENV["COVERALLS_REPO_TOKEN"] = ENV["HOMEBREW_COVERALLS_REPO_TOKEN"]
|
|
||||||
|
|
||||||
ENV["CI_BUILD_NUMBER"] = ENV["HOMEBREW_CI_BUILD_NUMBER"]
|
|
||||||
ENV["CI_BRANCH"] = ENV["HOMEBREW_CI_BRANCH"]
|
|
||||||
%r{refs/pull/(?<pr>\d+)/merge} =~ ENV["HOMEBREW_CI_BUILD_NUMBER"]
|
|
||||||
ENV["CI_PULL_REQUEST"] = pr
|
|
||||||
ENV["CI_BUILD_URL"] = "https://github.com/#{ENV["HOMEBREW_GITHUB_REPOSITORY"]}/pull/#{pr}/checks"
|
|
||||||
|
|
||||||
ENV["CI_JOB_ID"] = ENV["TEST_ENV_NUMBER"] || "1"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
|
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user