chore: add code coverage as badge

This commit is contained in:
Enot (ded) Skelly committed 2026-06-09 09:52:04 -07:00
1 parent 5950088f5e
commit 7c993390d3
2 files changed
+21 -1

No files matched your search

+19
View File
@@ -31,3 +31,22 @@ jobs:
- name: Display coverage
run: go tool cover -func=coverage.out
- name: Extract coverage percentage
id: coverage
run: |
COVERAGE=$(go tool cover -func=coverage.out | grep ^total | awk '{print $3}' | tr -d '%')
echo "pct=$COVERAGE" >> $GITHUB_OUTPUT
- name: Update coverage badge
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 3e707bdf3f06ecb4575166ce598051c3
filename: beacon-coverage.json
label: coverage
message: ${{ steps.coverage.outputs.pct }}%
valColorRange: ${{ steps.coverage.outputs.pct }}
maxColorRange: 100
minColorRange: 0
if: github.ref == 'refs/heads/main'