From 33a5bc7c5bb29d2b41746bc2cb7b7eb28a7156f0 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Wed, 2 Aug 2023 19:47:41 -0400 Subject: [PATCH] build: color by whether full code coverage has been achieved --- .github/workflows/scripts/run_tests_coverage | 4 ++-- .../@stdlib/random/base/hypergeometric/lib/hin.js | 1 - .../@stdlib/random/base/hypergeometric/lib/hypergeometric.js | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/run_tests_coverage b/.github/workflows/scripts/run_tests_coverage index 81edafa6b7e..e55202234a4 100644 --- a/.github/workflows/scripts/run_tests_coverage +++ b/.github/workflows/scripts/run_tests_coverage @@ -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="$pkg" 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: diff --git a/lib/node_modules/@stdlib/random/base/hypergeometric/lib/hin.js b/lib/node_modules/@stdlib/random/base/hypergeometric/lib/hin.js index e922e81886e..b18d5b37798 100644 --- a/lib/node_modules/@stdlib/random/base/hypergeometric/lib/hin.js +++ b/lib/node_modules/@stdlib/random/base/hypergeometric/lib/hin.js @@ -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 diff --git a/lib/node_modules/@stdlib/random/base/hypergeometric/lib/hypergeometric.js b/lib/node_modules/@stdlib/random/base/hypergeometric/lib/hypergeometric.js index 27c4f7b374e..c5d0c7def4f 100644 --- a/lib/node_modules/@stdlib/random/base/hypergeometric/lib/hypergeometric.js +++ b/lib/node_modules/@stdlib/random/base/hypergeometric/lib/hypergeometric.js @@ -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