mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-10-22 22:21:27 +00:00
chore: add code coverage as badge
This commit is contained in:
2 files changed
+21
-1
No files matched your search
@@ -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'
|
||||
Reference in new issue
Block a user