|
56 | 56 |
|
57 | 57 | - name: Check coverage thresholds and add reports in PR comments |
58 | 58 | id: jacoco |
59 | | - uses: MoranaApps/jacoco-report@v2 |
| 59 | + uses: MoranaApps/jacoco-report@54bfe284d1119dc917dddba80517c54c5bcf3627 |
60 | 60 | with: |
61 | 61 | token: '${{ secrets.GITHUB_TOKEN }}' |
62 | 62 | paths: | |
|
67 | 67 | min-coverage-changed-files: ${{ env.coverage-changed-files }} |
68 | 68 | min-coverage-per-changed-file: ${{ env.coverage-per-changed-file }} |
69 | 69 | skip-unchanged: false |
70 | | - |
71 | | - # - name: Add coverage to PR |
72 | | - # if: steps.jacocorun.outcome == 'success' |
73 | | - # id: jacoco-balta |
74 | | - # uses: madrapps/jacoco-report@50d3aff4548aa991e6753342d9ba291084e63848 |
75 | | - # with: |
76 | | - # paths: ${{ github.workspace }}/balta/target/scala-${{ env.scalaShort }}/jacoco/report/jacoco.xml |
77 | | - # token: ${{ secrets.GITHUB_TOKEN }} |
78 | | - # min-coverage-overall: ${{ env.coverage-overall }} |
79 | | - # min-coverage-changed-files: ${{ env.coverage-changed-files }} |
80 | | - # title: JaCoCo 'balta' module code coverage report - scala ${{ env.scalaLong }} |
81 | | - # update-comment: true |
82 | | - # - name: Get the Coverage info |
83 | | - # if: steps.jacocorun.outcome == 'success' |
84 | | - # run: | |
85 | | - # echo "Total 'balta' module coverage ${{ steps.jacoco-balta.outputs.coverage-overall }}" |
86 | | - # echo "Changed Files coverage ${{ steps.jacoco-balta.outputs.coverage-changed-files }}" |
87 | | - # - name: Fail PR if changed files coverage is less than ${{ env.coverage-changed-files }}% |
88 | | - # if: steps.jacocorun.outcome == 'success' |
89 | | - # uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd |
90 | | - # with: |
91 | | - # script: | |
92 | | - # const coverageCheckFailed = |
93 | | - # Number('${{ steps.jacoco-balta.outputs.coverage-changed-files }}') < Number('${{ env.coverage-changed-files }}') |
94 | | - # if (coverageCheckFailed) { |
95 | | - # core.setFailed('Changed files coverage is less than ${{ env.coverage-changed-files }}%!'); |
96 | | - # } |
97 | | - # - name: Fail PR if overall files coverage is less than ${{ env.coverage-overall }}% |
98 | | - # if: ${{ (steps.jacocorun.outcome == 'success') && (env.check-overall-coverages == 'true') }} |
99 | | - # uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd |
100 | | - # with: |
101 | | - # script: | |
102 | | - # const coverageCheckFailed = |
103 | | - # Number('${{ steps.jacoco-balta.outputs.coverage-overall }}') < Number('${{ env.coverage-overall }}'); |
104 | | - # if (coverageCheckFailed) { |
105 | | - # core.setFailed('Overall coverage is less than ${{ env.coverage-overall }}%!'); |
106 | | - # } |
107 | | - # - name: Edit JaCoCo comments on build failure |
108 | | - # if: steps.jacocorun.outcome != 'success' |
109 | | - # uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd |
110 | | - # with: |
111 | | - # script: | |
112 | | - # const issue_number = context.issue.number; |
113 | | - # const owner = context.repo.owner; |
114 | | - # const repo = context.repo.repo; |
115 | | - # const jacocoReportRegExp = /^### JaCoCo .* code coverage report .*/; |
116 | | - |
117 | | - # const comments = await github.rest.issues.listComments({ |
118 | | - # owner, |
119 | | - # repo, |
120 | | - # issue_number, |
121 | | - # }); |
122 | | - |
123 | | - # for (const comment of comments.data) { |
124 | | - # const lines = comment.body.split('\n'); |
125 | | - # if (lines.length > 0 && jacocoReportRegExp.test(lines[0])) { |
126 | | - # await github.rest.issues.updateComment({ |
127 | | - # owner, |
128 | | - # repo, |
129 | | - # comment_id: comment.id, |
130 | | - # body: lines[0] + "\n\n### Build Failed", |
131 | | - # }); |
132 | | - # } |
133 | | - # } |
134 | | - |
135 | | - # core.setFailed('JaCoCo test coverage report generation failed, and related PR comments were updated.'); |
0 commit comments