Change PR build to generate coverage and comment it (#1474)

This extends the github actions to by default run the coverage
generation targets. The targets will generate the coverage artifacts,
which will then be used by a seprate github action to comment on the PR
the coverage numbers.

This is a sanity check for testing information for new features and
refactors alike. It will allow reviewers to quickly identify if there
are major issues with new tests, or large changes to coverage percentage
that indicate a problem.
This commit is contained in:
Noah Thornton
2026-05-04 11:10:02 -07:00
committed by GitHub
parent 2ee3f3d0a1
commit d12d64d488
4 changed files with 150 additions and 3 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ define GENERATE_COV_REPORTS
-output-dir=$(COVERAGE_OUTPUT_DIR)/$(2)/html \
$(TEST_BINARY)
@echo Extracting $(2) coverage percentages...
@jq -r '"line coverage: \(.data[0].totals.lines.percent * 100 | round / 100)%\nfunction coverage: \(.data[0].totals.functions.percent * 100 | round / 100)%"' \
@jq -r '"line coverage: \(.data[0].totals.lines.percent | . * 100 | round | . / 100)%\nfunction coverage: \(.data[0].totals.functions.percent | . * 100 | round | . / 100)%"' \
$(COVERAGE_OUTPUT_DIR)/$(2)/coverage-summary.json > $(COVERAGE_OUTPUT_DIR)/$(2)/coverage-percent.txt
@cat $(COVERAGE_OUTPUT_DIR)/$(2)/coverage-percent.txt
endef