aki77 / simplecov-report-action

A GitHub Action that report simplecov coverage.
MIT License
39 stars 21 forks source link

Getting `warning: Cannot find the PR id` when attempting to use reporting action #20

Closed csaunders-humi closed 2 years ago

csaunders-humi commented 2 years ago

When attempting to integrate this into a github action that takes in aggregated coverage reports I am getting the warning message mentioned in the title. I've looked around to see if anyone else has had a similar issue and I am thinking that actions/toolkit #289 might have exhibited similar behaviour.

It appears that the fix on that project was to check several different potential sources for the issue number.

It's also entirely possible that I'm not using this action as it was originally intended.


Here is the portion of my github action that is supposed to be generating the report:

      - name: Download coverage reports
        uses: actions/download-artifact@v2
        with:
          path: coverage/ # contains several directories (i.e. coverage/{group_one,group_two,...}/.resultset.json)

      - name: Collate reports
        run: ./github_scripts/coverage_report # generates a collated report which includes coverage/.resultset.json and coverage/.last_run.json

      - name: Create tarball of reports
        run: tar -czvf rspec-coverage-report.tar.gz coverage/

      - name: Upload collated coverage report
        uses: actions/upload-artifact@v2
        with:
          path: rspec-coverage-report.tar.gz

      - name: Generate Github coverage comment
        uses: aki77/simplecov-report-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

Output from github actions page

image

csaunders-humi commented 2 years ago

I was trying to use this on Push events which is why it wasn't working. I was able to come up with a solution that makes it work with that workflow instead.

lukelex commented 2 years ago

Could you share the solution you've found?

sasharevzin commented 2 years ago

@csaunders-humi what was the solution?

csaunders-humi commented 2 years ago

I used different github actions and ran simplecov myself. If your tests are broken across multiple runners, each runner generates an artifact and you aggregate them when running simplecov.

sasharevzin commented 2 years ago

oh, I see. what GitHub action did you use?

csaunders-humi commented 2 years ago

It used find-pull-request-action to figure out what PR the change was for, then used create-or-update-comment to append a message.

It wasn't reliable.

sasharevzin commented 2 years ago

oh, that sounds complicated. i guess i'll stick with simplecov-report-action, hehe

aki77 commented 2 years ago

Push events are also supported in v1.5.0. 🎉

https://github.com/aki77/simplecov-report-action/actions/runs/2554073982