Skip to content

Create a GitHub CI workflow for publishing unit test reports#21

Merged
msteinert merged 1 commit into
mainfrom
junit-results
Aug 19, 2025
Merged

Create a GitHub CI workflow for publishing unit test reports#21
msteinert merged 1 commit into
mainfrom
junit-results

Conversation

@rdmark

@rdmark rdmark commented Aug 13, 2025

Copy link
Copy Markdown
Collaborator

Build and run unit tests with code coverage support, execute tests to get a junit report, publish the report, generate and publish a lcon style code coverage report

@rdmark

rdmark commented Aug 13, 2025

Copy link
Copy Markdown
Collaborator Author

@msteinert I now have unit test result reports and code coverage reports up and running here in GitHub CI! See f.e. https://github.com/msteinert/bstring/actions/runs/16941054221

These actions that I'm using have the ability to decorate PRs with the reports for an even nicer integration. Would you be open to granting the two permissions required? (create an issue comment and create a check run)

@msteinert

Copy link
Copy Markdown
Owner

To enable this I need to add a GitHub seccret GITHUB_TOKEN with the two permissions you mentioned?

@rdmark

rdmark commented Aug 19, 2025

Copy link
Copy Markdown
Collaborator Author

Hmm, actually let me try first if it's a simple missing permissions in the workflow definition.

@github-actions

github-actions Bot commented Aug 19, 2025

Copy link
Copy Markdown

LCOV of commit 42caa13 during Unit Tests #7

Summary coverage rate:
  lines......: 86.1% (4284 of 4974 lines)
  functions..: 96.5% (248 of 257 functions)
  branches...: 60.9% (2711 of 4448 branches)

Files changed coverage rate: n/a

Build and run unit tests with code coverage support, execute tests to get a junit report, publish the report, generate and publish a lcon style code coverage report
@rdmark rdmark marked this pull request as ready for review August 19, 2025 18:14
@sonarqubecloud

Copy link
Copy Markdown

@rdmark rdmark requested a review from msteinert August 19, 2025 18:22
@rdmark

rdmark commented Aug 19, 2025

Copy link
Copy Markdown
Collaborator Author

@msteinert Problem solved. No need to prepare any token. The coverage report is now posted to the PR!

Now the only outstanding issue is that the code coverage stats includes the test code itself, which inflates the coverage stats. There's a known limitation with the interaction between meson and lcov as described in the issue below.

mesonbuild/meson#3287

I can attempt a workaround.

@msteinert

Copy link
Copy Markdown
Owner

Nicely done! It would be really cool if the gcovr report could available.

Maybe this (publish to Coveralls)? https://github.com/marketplace/actions/gcovr-action

Or is it overkill for this project?

@msteinert msteinert merged commit c44d45c into main Aug 19, 2025
15 checks passed
@rdmark rdmark deleted the junit-results branch August 19, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants