Skip to content

Commit 6971f3f

Browse files
committed
Adding JSON validation for coverage reports
1 parent 82678f0 commit 6971f3f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/scripts/collect-coverage.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ if ! jq empty "$summary_file" 2>/dev/null; then
4040
cat "$summary_file"
4141
echo ""
4242
echo "Attempting to fix common issues..."
43-
43+
4444
# Try to fix common JSON issues (NaN, Infinity, etc.)
4545
# Replace NaN and Infinity with null or 0
4646
tmp_file=$(mktemp)
4747
sed 's/: NaN/: 0/g; s/: Infinity/: 100/g; s/: -Infinity/: 0/g' "$summary_file" > "$tmp_file"
48-
48+
4949
if jq empty "$tmp_file" 2>/dev/null; then
5050
echo "Successfully fixed JSON issues"
5151
mv "$tmp_file" "$summary_file"

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ jobs:
103103
echo "Generated Summary.json:"
104104
cat ./coverage-reports/Summary.json || echo "File not found"
105105
106+
# Debug: Show the generated file
107+
echo "Generated Summary.json:"
108+
cat ./coverage-reports/Summary.json || echo "File not found"
109+
106110
- name: Collect coverage statistics
107111
run: |
108112
.github/scripts/collect-coverage.sh \

0 commit comments

Comments
 (0)