I second @ggjulio 's opinion that we should be able to split sonar-scanner in 2 stages:
- static analysis
- publishing the results.
Ideally we would love to be able to run Sonar in CI pipelines with parallel stages. This would allow us to have our unittests to compile and run in some stages, while sonar is executing the static analysis in multiple stages (one stage per language), the sonar analysis stages then stash the report files and at the end of the pipeline we have a final sonar stage that will:
- aggregate the test results, coverage reports, static analysis from other tools (such as golangci-lint), the static analysis from the sonar analysis stages.
- publish that to the Sonar backend
This approach would shave 10m or more per CI pipeline for many customers, especially customers with larger repos. As long as the git hash is consistent across all the stages, this should not be too difficult to implement.