davelosert/vitest-coverage-report-action

Adding multiple coverage reports to a single workflow

Closed this issue ยท 2 comments

I am currently trying to add coverage reports with separate coverage gates between .ts and .tsx files, based on my configuration in my workflow yaml file, the coverage reporter post is being overwritten depending on the coverage reporter step i have defined later in the steps.
Here is my configuration:

      - name: Generate .tsx coverage report
        run: |
          npm run coverage:tsx
        if: always() # Also generate the report if tests are failing

      - name: Report .tsx File Coverage
        uses: davelosert/vitest-coverage-report-action@v1
        with:
          json-summary-path: './coverage/tsx/coverage-summary.json'
          json-final-path: './coverage/tsx/coverage-final.json'

      - name: Generate .ts coverage report
        run: |
          npm run coverage:ts
        if: always() # Also generate the report if tests are failing

      - name: Report .ts File Coverage
        uses: davelosert/vitest-coverage-report-action@v1
        with:
          json-summary-path: './coverage/ts/coverage-summary.json'
          json-final-path: './coverage/ts/coverage-final.json'

I am looking for a way to ensure that the two separate coverages can post on the same PR, hoping this is something that is supported or there is a workaround, thanks!

Hi @aprehatny,

thank you for your feedback and the suggestion.
Currently, this is not supported as I am using a static markdown-comment marker to find the right comment and update it (which means two different jobs will overwrite the same comment as you experience it).

However, it should be easy to make the comment marker configurable and - as such - allow the feature you are requesting.

My first hunch was to simply give the option to configure a name for the report itself and use that name as an addition to the comment-marker. I'll give this a go later today.

๐ŸŽ‰ This issue has been resolved in version 2.1.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€