GitHub Actions setup for maven and ts

Alright I see multiple issues, and some confusion, let’s crack them one by one.

Test coverage from a Maven build

The verify goal of Maven implies the execution of test, by Maven, so it does look like tests are executed. However, that’s just a small part of seeing coverage data. You also need to:

  • configure your build to actually produce a coverage report
  • configure your SonarCloud analysis so it can find and import the coverage reports

We have a dedicated guide to help you with the above steps. That should resolve this.

Using Automatic Analysis

You wrote that:

I think there’s a confusion here. Automatic Analysis is not compatible with GitHub Actions. You use one or the other, not both together.

When you import your project on SonarCloud, we try to detect if it’s eligible for Automatic Analysis (eligible = most of the code is non-compiled languages). If the answer is yes, we activate Automatic Analysis. You can also force the activation manually. When Automatic Analysis is active, the project will be scanned automatically on every commit (ignoring compiled code, for now), no CI setup (GitHub Action) is needed, in fact any analyses coming from CI builds would be rejected while Automatic Analysis is active.

In any case, since it seems you want to run multiple analyses for different parts of the same repo (Java ↔ TS), I think Automatic Analysis is not a good fit for you, see the next section.

Running multiple analyses for different parts of the same repo

This is what we call a “monorepo setup”. This announcement describes the feature, with a link to the documentation which I hope will help.