Skip to content

Commit

Permalink
Update test-coverage.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mrugama authored Feb 16, 2025
1 parent bd1056e commit 70a7337
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ jobs:
echo "### 📄 File-wise Coverage Breakdown" >> coverage_section.md
echo "| File | Covered Lines | Executable Lines | Coverage |" >> coverage_section.md
echo "|------|--------------|-----------------|----------|" >> coverage_section.md
# Loop through each file in coverage.json and add to table
jq -r '.targets[].files[] | "| \(.name) | \(.coveredLines) | \(.executableLines) | [![Coverage]($(generate_badge \((.lineCoverage * 100) | round))](https://github.com/mrugama/Weather/actions) |"' coverage.json >> coverage_section.md
# Generate file-wise coverage rows with dynamic badges
jq -r '.targets[].files[] | "\(.name) \(.coveredLines) \(.executableLines) \(.lineCoverage * 100 | round)"' coverage.json | while read -r name coveredLines executableLines coverage; do
BADGE_URL=$(generate_badge $coverage)
echo "| $name | $coveredLines | $executableLines | [![Coverage]($BADGE_URL)](https://github.com/mrugama/Weather/actions) |" >> coverage_section.md
done
echo "---" >> coverage_section.md
echo "" >> coverage_section.md
Expand Down

0 comments on commit 70a7337

Please sign in to comment.