summaryrefslogtreecommitdiff
path: root/Magefile.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-26 22:23:01 +0200
committerPaul Buetow <paul@buetow.org>2026-03-26 22:23:01 +0200
commit5603667541240cc7eaf3b8cd2352bf12c1bdd8f2 (patch)
treed32c1e7ce26d290c6d4fce9a2a4e087c2bcad0b9 /Magefile.go
parent9dc8c5e241af77fd61c1da91e0fe49faa5cf06e4 (diff)
build: enforce coverage threshold
Diffstat (limited to 'Magefile.go')
-rw-r--r--Magefile.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/Magefile.go b/Magefile.go
index c87f63a..0d52d30 100644
--- a/Magefile.go
+++ b/Magefile.go
@@ -257,6 +257,13 @@ func Coverage() error {
return err
}
fmt.Println("HTML coverage report written to " + html + " (cross-package)")
+ total, ok := totalCoveragePercent(prof)
+ if !ok {
+ return fmt.Errorf("parse total coverage from %s", prof)
+ }
+ if total < coverageThreshold {
+ return fmt.Errorf("total coverage %.1f%% is below threshold %.1f%%", total, coverageThreshold)
+ }
return nil
}