camunda-community-hub / community-action-maven-release

Opinionated GitHub action to release community projects to Maven Central
Apache License 2.0
7 stars 4 forks source link

enhancement: Archive unit test results when run-tests = true #34

Closed remcowesterhoud closed 1 year ago

remcowesterhoud commented 2 years ago

When I set run-tests to true the workflow will execute the unit tests for me. However, if any of the tests happen to fail, it will not archive the test results. Therefore I'd have to look into the build logs manually to see what went wrong. It'd be a nice addition if we could add an archiving step to this action.

This would mean we need to archive and publish the results on failure, something like:

      - name: Archive Test Results on Failure
        uses: actions/upload-artifact@v2
        if: failure()
        with:
          name: test-results
          path: target/surefire-reports/
          retention-days: 7

      - name: Publish Unit Test Results
        id: publish
        uses: EnricoMi/publish-unit-test-result-action@v1.25
        if: failure()
        with:
          files: target/surefire-reports/*.xml
remcowesterhoud commented 2 years ago

@celanthe I'd love to hear your thoughts on adding this.

celanthe commented 2 years ago

@remcowesterhoud I think this is a great idea. I would be happy to take this on and try to get it into the next release of the Action! :)

berndruecker commented 2 years ago

@remcowesterhoud I think archiving the test results definitely makes sense - would you want to provide a PR for this by any chance?

For JaCoCo: Why is this needed? Why not simply go with the normal rest test results and avoid an additional dependency?

remcowesterhoud commented 2 years ago

@berndruecker My bad, we don't need JaCoCo, not sure why I thought we did when I created the issue. I've removed it from the description.

I could make a PR sometime. It won't be soon as I'll be on holiday tomorrow.

berndruecker commented 2 years ago

Ok great! - happy to merge it when it comes by!