Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Add support for codecov badge #299

Merged
merged 1 commit into from
Jun 5, 2019
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
4 changes: 4 additions & 0 deletions scripts/class-wordpress-readme-parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ function ( $tag ) {
'travis_ci_pro_url',
'travis_ci_url',
'coveralls_url',
'codecov_url',
'grunt_url',
'david_url',
'david_dev_url',
Expand All @@ -213,6 +214,9 @@ function ( $tag ) {
if ( 'coveralls_url' === $badge ) {
$badge_md .= sprintf( '[![Coverage Status](%s)](%s) ', $params['coveralls_badge_src'], $url );
}
if ( 'codecov_url' === $badge ) {
$badge_md .= sprintf( '[![Coverage Status](%s)](%s) ', $params['codecov_badge_src'], $url );
}
if ( 'grunt_url' === $badge ) {
$badge_md .= sprintf( '[![Built with Grunt](https://%1$s/cdn/builtwith.svg)](http://%1$s) ', $url );
}
Expand Down
5 changes: 5 additions & 0 deletions scripts/generate-markdown-readme
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ try {
$md_args['coveralls_badge_src'] .= "&service=github&t=$coveralls_badge";
}
}
if ( file_exists( $readme_root . '/codecov.yml' ) || file_exists( $readme_root . '/.codecov.yml' ) ) {
$branch = isset( $env_vars['DEFAULT_BASE_BRANCH'] ) ? $env_vars['DEFAULT_BASE_BRANCH'] : 'master';
$md_args['codecov_url'] = "https://codecov.io/gh/$github_account_repo";
$md_args['codecov_badge_src'] = "https://img.shields.io/codecov/c/github/$github_account_repo/$branch.svg";
}
if ( file_exists( $readme_root . '/Gruntfile.js' ) ) {
$md_args['grunt_url'] = 'gruntjs.com';
}
Expand Down