chore: fix coverage badge
All checks were successful
Format and Lint / format-check (push) Successful in 2m58s
Format and Lint / test (push) Successful in 2m10s

This commit is contained in:
Максим Слипенко 2024-12-26 18:40:16 +03:00
parent a433b4fc7a
commit dc6da3cabb
2 changed files with 10 additions and 10 deletions

View file

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="98" height="20">
<rect width="59" height="20" fill="#555"/>
<rect x="59" width="39" height="20" fill="#4c1"/>
<text x="30" y="14" fill="#fff" font-family="Verdana" font-size="11">coverage</text>
<text x="65" y="14" fill="#fff" font-family="Verdana" font-size="11">22.3%</text>
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="20">
<rect width="1100" height="20" fill="#555"/>
<rect x="60" width="50" height="20" fill="#4c1"/>
<text x="5" y="14" fill="#fff" font-family="Verdana" font-size="11">coverage</text>
<text x="70" y="14" fill="#fff" font-family="Verdana" font-size="11">22.3%</text>
</svg>

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 341 B

View file

@ -1,10 +1,10 @@
#!/bin/bash
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
cat <<EOF > coverage-badge.svg
<svg xmlns="http://www.w3.org/2000/svg" width="98" height="20">
<rect width="59" height="20" fill="#555"/>
<rect x="59" width="39" height="20" fill="#4c1"/>
<text x="30" y="14" fill="#fff" font-family="Verdana" font-size="11">coverage</text>
<text x="65" y="14" fill="#fff" font-family="Verdana" font-size="11">${COVERAGE}%</text>
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="20">
<rect width="1100" height="20" fill="#555"/>
<rect x="60" width="50" height="20" fill="#4c1"/>
<text x="5" y="14" fill="#fff" font-family="Verdana" font-size="11">coverage</text>
<text x="70" y="14" fill="#fff" font-family="Verdana" font-size="11">${COVERAGE}%</text>
</svg>
EOF