Skip to content

Commit d4ad852

Browse files
committed
updating post to better emphasize job summaries
1 parent ad2c068 commit d4ad852

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

_posts/2021-09-08-github-code-coverage.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ This is a follow-up to my previous post: [The Easiest Way to Generate and Publis
1919

2020
I was familiar with adding Code Coverage to my pipelines in Azure DevOps and having a Code Coverage tab appear on the pipeline summary page, but I wasn't sure what was available for GitHub Actions. With GitHub Actions really starting to pick up steam, especially with recent additions such as [Composite Actions](https://www.colinsalmcorner.com/github-composite-actions/), I thought now would be a great time to explore.
2121

22+
> Since this post was originally published, GitHub has added [Job Summaries](https://github.blog/news-insights/product-news/supercharging-github-actions-with-job-summaries/) which can be used to display the code coverage report summary right next to the workflow run logs! I've [updated this post with an additional section](#adding-code-coverage-to-job-summary) to include that functionality.
23+
{: .prompt-tip }
24+
2225
## Adding Code Coverage to Pull Request
2326

2427
I found this GitHub Action in the marketplace - [Code Coverage Summary](https://github.com/marketplace/actions/code-coverage-summary). There might be others, but this one seemed simple and had the functionality I was looking for.
@@ -108,7 +111,7 @@ The nice thing with this action is that if a new commit is pushed to the PR trig
108111
109112
## Adding Code Coverage to Job Summary
110113
111-
I think this is looking great, but what if we don't happen to create a pull request, how can we neatly see our code coverage report? Well, since May 9, 2022 (and GitHub Enterprise Server >= 3.6.0) we can use the [Job Summary](https://github.blog/changelog/2022-05-09-github-actions-enhance-your-actions-with-job-summaries/)!
114+
I think this is looking great, but what if we don't happen to create a pull request, how can we neatly see our code coverage report? Well, since May 9, 2022 (and GitHub Enterprise Server >= 3.6.0) we can use the [Job Summary](https://github.blog/news-insights/product-news/supercharging-github-actions-with-job-summaries/)!
112115
113116
Since the CodeCoverageSummary action is already generating the markdown for us, all we have to do is append it to the [`$GITHUB_STEP_SUMMARY`](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary) environment variable. Add in the following run command to the end of the job:
114117

@@ -145,6 +148,6 @@ _Code Coverage Summary Report generated by `reportgenerator` added to the job su
145148

146149
## Conclusion
147150

148-
Maybe not _as pretty_ as the Cobertura report shown in Azure DevOps, but just as effective! Certainly the addition of [job summaries](https://github.blog/changelog/2022-05-09-github-actions-enhance-your-actions-with-job-summaries/) makes this a better experience.
151+
Maybe not _as pretty_ as the Cobertura report shown in Azure DevOps, but just as effective! Certainly the addition of [job summaries](https://github.blog/news-insights/product-news/supercharging-github-actions-with-job-summaries/) makes this a better experience.
149152

150153
And hey, now on the GitHub Pull Request, you get to actually see the code coverage report before the *[end of the entire pipeline run](/posts/azure-devops-code-coverage/#code-coverage-tab-not-showing-up)* like in Azure DevOps 😀.

0 commit comments

Comments
 (0)