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

Commit

Permalink
Merge pull request #299 from xwp/add/codecov-badge
Browse files Browse the repository at this point in the history
Add support for codecov badge
  • Loading branch information
westonruter authored Jun 5, 2019
2 parents 4caaf0f + b53e082 commit d8207e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit d8207e7

Please sign in to comment.