@@ -108,6 +108,7 @@ jobs:
108108 retention-days : 1
109109
110110 coverage-report :
111+ if : ${{ success() || contains(needs.*.result, 'success') }}
111112 runs-on : ubuntu-latest
112113 needs :
113114 - kubernetes-api
@@ -120,17 +121,23 @@ jobs:
120121 with : { path: download }
121122
122123 # Combine the coverage profiles by taking the mode line from any one file
123- # and the data from all files. Print a list of functions with less than
124- # 100% coverage, and upload a complete HTML report.
124+ # and the data from all files. Write a list of functions with less than
125+ # 100% coverage to the job summary , and upload a complete HTML report.
125126 - name : Generate report
126127 run : |
127128 gunzip --keep download/*/*.gz
128129 ( sed -e '1q' download/*/*.coverage
129130 tail -qn +2 download/*/*.coverage ) > total.coverage
130131 go tool cover --func total.coverage -o total-coverage.txt
131132 go tool cover --html total.coverage -o total-coverage.html
132- sed -e '/100.0%/d' -e "s,$(go list -m)/,," total-coverage.txt
133- awk 'END { print "::notice title=Total Coverage::" $3 " " $2 }' total-coverage.txt
133+
134+ awk < total-coverage.txt '
135+ END { print "<details><summary>Total Coverage: <code>" $3 " " $2 "</code></summary>" }
136+ ' >> "${GITHUB_STEP_SUMMARY}"
137+
138+ sed < total-coverage.txt -e '/100.0%/d' -e "s,$(go list -m)/,," | column -t | awk '
139+ NR == 1 { print "\n\n```" } { print } END { if (NR > 0) print "```\n\n"; print "</details>" }
140+ ' >> "${GITHUB_STEP_SUMMARY}"
134141
135142 # Upload coverage to GitHub
136143 - run : gzip total-coverage.html
0 commit comments