Skip to content

Commit

Permalink
build: color by whether full code coverage has been achieved
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Aug 2, 2023
1 parent 3ac92a3 commit 33a5bc7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/scripts/run_tests_coverage
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ main() {

# For each package, extract coverage value from the respective coverage report:
pkg=`echo $package | sed -E 's/^.*stdlib\///'`
pkg_cov=`cat reports/coverage/lcov-report/$pkg/lib/index.html | grep "fraction" | grep -oP '\d+/\d+' | printf %s "$(cat)" | jq -R -s -c 'split("\n")'`
pkg_cov=$(cat reports/coverage/lcov-report/$pkg/lib/index.html | grep "fraction" | grep -oP '\d+/\d+' | awk -F'/' '{if ($1<$2) print "$\\color{red}" $0 "$"; else print "$\\color{green}" $0 "$"}' | jq -R -s -c 'split("\n")')
pkg_url="https://github.com/${github_repo}/tree/${github_ref}/${package}"
pkg_link="<a href="$pkg_url">$pkg</a>"
coverage="$coverage\n| $pkg_link $pkg_cov"

# Copy coverage report of the package to artifacts directory:
cp -r reports/coverage/lcov-report/$pkg artifacts/
mkdir -p "artifacts/${pkg}" && cp -r "reports/coverage/lcov-report/${pkg}"/* "artifacts/${pkg}/"
done

# Format coverage as Markdown table row:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ var factorial = require( '@stdlib/math/base/special/factorial' );
*
* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839
*
*
* @private
* @param {PRNG} rand - PRNG for uniformly distributed numbers
* @param {NonNegativeInteger} n1 - number of successes in population
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ var hin = require( './hin.js' );
*
* [@kachitvichyanukul:1985]: http://dx.doi.org/10.1080/00949658508810839
*
*
* @private
* @param {PRNG} rand - PRNG for uniformly distributed numbers
* @param {NonNegativeInteger} N - population size
Expand Down

1 comment on commit 33a5bc7

@stdlib-bot
Copy link
Contributor

@stdlib-bot stdlib-bot commented on 33a5bc7 Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
random/base/hypergeometric $\color{red}639/643$ $\color{red}70/71$ $\color{green}13/13$ $\color{red}639/643$

The above coverage report was generated for the changes in this push.

Please sign in to comment.