feat: Add coverage reporting and analysis workflows, enhance CI with additional tests for older Go versions

This commit is contained in:
ProtoTess
2025-12-01 00:44:34 +00:00
parent 4f3e2a6df0
commit 856f49c82d
12 changed files with 334 additions and 66 deletions
+42
View File
@@ -0,0 +1,42 @@
name: Additional Coverage Reports
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [master, main]
jobs:
# Generate additional coverage analysis if CI passed
coverage-analysis:
name: Coverage Analysis
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: coverage-report
- name: Check coverage percentage
run: |
if [ -f coverage.out ]; then
coverage=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
echo "Coverage: $coverage%"
# Set threshold to 40%
if (( $(echo "$coverage < 40" | bc -l) )); then
echo "⚠️ Coverage below 40% threshold: $coverage%"
else
echo "✅ Coverage above threshold: $coverage%"
fi
fi
- name: Upload coverage badge
continue-on-error: true
run: |
# Optional: Update badges or notifications
echo "Coverage analysis complete"