Uploading code coverage to SonarCloud

We are evaluating SonarCloud for a monorepo with five or so different programming languages.

The repo is set up with GitHub Actions, and there are actions for each major package that are kicked off only when there’s a change in that particular subset of the monorepo.

We currently don’t run tests across the entire monorepo for any merge into the main branch, meaning tests are only run on a given merge for the package(s) being changed.

I’m curious about two main things:

  1. How would we maintain a consistent view of code coverage under this paradigm?
  2. We would prefer to run code quality analysis within SonarCloud, but keep the rest of our jobs within GitHub Actions. At scale, executing from within GitHub Actions introduces additional cost to us in terms of billable minutes. Is there a plan to support uploading code coverage to SonarCloud for a particular pull request, separate from CI?


Welcome to the community!

What you’re looking for is aggregation, which we’re planning to make available on SonarCloud “soon” (I don’t have dates for you).

No. Analysis is not additive. The coverage reports must be available when analysis runs.


1 Like