Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,14 @@ jobs:
mkdir -p .nyc_output
cp coverage/coverage-final.json .nyc_output/out.json
set +e
echo "Running nyc check-coverage (threshold ${MIN}%)..."
npx --yes nyc check-coverage --lines=$MIN --statements=$MIN --functions=$MIN --branches=$MIN
EXIT=$?
set -e
PCT=$(npx --yes nyc report --reporter=text-summary 2>/dev/null | sed -n 's/^Lines[^:]*: *\([0-9.]*\)%.*/\1/p')
echo "Running nyc report (text-summary)..."
NYC_REPORT=$(npx --yes nyc report --reporter=text-summary 2>&1)
echo "$NYC_REPORT"
PCT=$(echo "$NYC_REPORT" | sed -n 's/^Lines[^:]*: *\([0-9.]*\)%.*/\1/p')
[ -z "$PCT" ] && PCT="—"
[ $EXIT -eq 0 ] && ICON="✅" || ICON="❌"
echo "coverage_result=$ICON Coverage ${PCT}% (min ${MIN}%)" >> "$GITHUB_OUTPUT"
Expand Down