paambaati / codeclimate-action

GitHub Action to send your code coverage to CodeClimate
MIT License
201 stars 63 forks source link

JaCoCo with Maven multi-module or Gradle multi-project builds #208

Open derekm opened 4 years ago

derekm commented 4 years ago

Describe the bug coverageLocations can be multiple values, but JACOCO_SOURCE_PATH can only contain one value.

In a Java build that produces multiple jars, I need a different JaCoCo source path per coverage location.

Version of codeclimate-action you're using v2.5.7

Expected behavior I should be able to specify the source paths for each coverage location.

Additional context This may need to be reported upstream here: https://github.com/codeclimate/test-reporter

fnobilia commented 3 years ago

Hi guys! I'm having the same issue. Here you can see an example of the error, and this is the PR where I am adding the action.

afranken commented 3 years ago

Looking at the codeclimate test-reporter's code reveals that a whitespace separated list is expected as input: https://github.com/codeclimate/test-reporter/commit/b2ae857af964b1f4161d004238c45e1bf666f4f6

Unfortunately, this action does not support globbing for the environment variables (I'm guessing that it's not possible to re-set an environment variable from within the running action?), so while I can use tree globbing "**" for the coverageLocations, I have to explicitly list every modules source directories...

Working example: https://github.com/afranken/advent-of-code-java/blob/main/.github/workflows/maven-ci.yml