Skip to content

Commit

Permalink
Add test coverage PR comment action (cfug#2150)
Browse files Browse the repository at this point in the history
<!-- Write down your pull request descriptions. -->

### New Pull Request Checklist

- [ ] I have read the
[Documentation](https://pub.dev/documentation/dio/latest/)
- [ ] I have searched for a similar pull request in the
[project](https://github.com/cfug/dio/pulls) and found none
- [ ] I have updated this branch with the latest `main` branch to avoid
conflicts (via merge from master or rebase)
- [ ] I have added the required tests to prove the fix/feature I'm
adding
- [ ] I have updated the documentation (if necessary)
- [ ] I have run the tests without failures
- [ ] I have updated the `CHANGELOG.md` in the corresponding package

### Additional context and info (if any)

<!-- Provide more context and info about the PR. -->
  • Loading branch information
kuhnroyal authored Mar 20, 2024
1 parent 438478d commit faa0b6c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
pull-requests: write

defaults:
run:
shell: bash -leo pipefail {0}
Expand Down Expand Up @@ -96,7 +99,15 @@ jobs:
run: melos run coverage:show
- name: '[Coverage] Coverage Report'
uses: clearlyip/code-coverage-report-action@v4
id: code_coverage_report
if: ${{ matrix.sdk == 'stable' && github.actor != 'dependabot[bot]'}}
with:
artifact_download_workflow_names: 'tests,coverage_base'
artifact_download_workflow_names: 'Verify packages abilities,coverage_baseline'
filename: 'coverage/cobertura.xml'
- name: '[Coverage] Add PR comment'
uses: marocchino/sticky-pull-request-comment@v2
#Make sure the report was generated and that the event is actually a pull request, run if failed or success
if: ${{ matrix.sdk == 'stable' && github.actor != 'dependabot[bot]' && steps.code_coverage_report.outputs.file != '' && (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && (success() || failure()) }}
with:
recreate: true
path: code-coverage-results.md

0 comments on commit faa0b6c

Please sign in to comment.