Skip to content

Commit 6590deb

Browse files
Beforerrclaude
andauthored
ci: emit Go coverage summary to the job summary (#29)
Run go test with -coverprofile and post the per-function table + total to GITHUB_STEP_SUMMARY on the ubuntu job. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7f88e47 commit 6590deb

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,15 @@ jobs:
2424
with:
2525
rtools-version: none
2626
- run: julia -e 'using Pkg; Pkg.add("Revise")'
27-
- run: go test -C go -v -timeout 300s
27+
- run: go test -C go -v -timeout 300s -coverprofile=coverage.out -covermode=atomic
28+
- name: Coverage summary
29+
if: matrix.os == 'ubuntu-latest'
30+
shell: bash
31+
run: |
32+
{
33+
echo '### Go coverage'
34+
echo '```'
35+
go tool cover -func=go/coverage.out
36+
echo '```'
37+
} >> "$GITHUB_STEP_SUMMARY"
38+
go tool cover -func=go/coverage.out | tail -n1

0 commit comments

Comments
 (0)