MishaKav / jest-coverage-comment

Comments a pull request or commit with the jest code coverage badge, full report and tests summary
MIT License
80 stars 34 forks source link

multiple-files seems not working #73

Closed Chongfuyu closed 1 year ago

Chongfuyu commented 1 year ago

Using multiple-files for coverage-summary json and it will shows not exist, however, when using the coverage-summary-path for each of them works well.

MishaKav commented 1 year ago

can you please share more details about this issue? your jest-coverage-comment configuration, some logs from it, maybe some screenshots from output or warning that you have...

Chongfuyu commented 1 year ago

@MishaKav thank you for quick responding.

while calling 3 times for each package works

      - name: Jest coverage comment
        uses: MishaKav/jest-coverage-comment@main
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          coverage-summary-path: ${{ github.workspace }}/packages/XXXX/coverage/coverage-summary.json
          report-only-changed-files: true

However, when using multiple-files it will show error for coverage-summary.json not exist

      - name: Jest coverage comment
        uses: MishaKav/jest-coverage-comment@main
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          multiple-files: |
               ReportA, ${{ github.workspace }}/packages/A/coverage/coverage-summary.json
               ReportB, ${{ github.workspace }}/packages/B/coverage/coverage-summary.json
          report-only-changed-files: true
MishaKav commented 1 year ago

if so, looks like your files don't exist. I run it couple of times with different configs, looks like this work, here are example

I can suggest running simple cat command, to see if the file exists, something like:

  - name: check if file exists
    run: cat ${{ github.workspace }}/packages/A/coverage/coverage-summary.json
Chongfuyu commented 1 year ago

thanks, my bad, I checked the path and compare with${{ github.workspace }}, which gives wrong path.