Add sonar coverage reporting to master build #184
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Submits analysis to sonar on master branch build.
New sonar project is at https://sonarcloud.io/dashboard?id=OpenAPITools_openapi-diff
This submits sonar for the Java 11 build. Sonar will complain for any code submitted and built against Java 8, as support for Java 8 will be removed soon. This also adds and configures Jacoco for coverage instrumentation in the root pom. The
sonar.branch.name
configuration is dynamic as this would allow extending this workflow for other branches without submitting these all tomaster
.As a side note, there's no clean way to run a sonar PR check because Sonar requires a secret token and these are not available in the
pull_request
event. We might be able to work something out with thepull_request_target
event (which runs in the scope of the master branch), but that would require a bit of work and poses a potential security risk. Sonar also doesn't support automated checks for compiled languages.I haven't included a sonar badge in the readme here. Some options are below.
"official" badge
Renders as:
Coverage Shield
Renders as:
Quality Gate Shield
Renders as:
Total Tests Shield
Renders as: