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'
+2 -1
View File
@@ -4,8 +4,9 @@ MeshCore Beacon is a MeshCore network observation backend. It connects to one or
more MeshCore MQTT brokers, ingests LoRa packet traffic in real time, stores it
in PostgreSQL, and streams live events to WebSocket clients.
[![CodeQL](https://github.com/MeshCore-Beacon/beacon-server/actions/workflows/codeql.yml/badge.svg)](https://github.com/MeshCore-Beacon/beacon-server/actions/workflows/codeql.yml)
[![CI](https://github.com/MeshCore-Beacon/beacon-server/actions/workflows/ci.yml/badge.svg)](https://github.com/MeshCore-Beacon/beacon-server/actions/workflows/ci.yml)
[![CodeQL](https://github.com/MeshCore-Beacon/beacon-server/actions/workflows/codeql.yml/badge.svg)](https://github.com/MeshCore-Beacon/beacon-server/actions/workflows/codeql.yml)
![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/ded/3e707bdf3f06ecb4575166ce598051c3/raw/beacon-coverage.json)
[![Docker](https://github.com/MeshCore-Beacon/beacon-server/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/MeshCore-Beacon/beacon-server/actions/workflows/docker-publish.yml)
## What it does