|
75 | 75 | run: chmod +x ./gradlew
|
76 | 76 | - name: Gradle Test
|
77 | 77 | run: ./gradlew test
|
| 78 | + - name: Collect JaCoCo Report |
| 79 | + if: ${{ github.event_name != 'pull_request' }} |
| 80 | + id: jacoco_reporter |
| 81 | + uses: PavanMudigonda/[email protected] |
| 82 | + with: |
| 83 | + coverage_results_path: build/jacoco.xml |
| 84 | + coverage_report_name: Code Coverage |
| 85 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 86 | + skip_check_run: false |
| 87 | + minimum_coverage: 85 |
| 88 | + fail_below_threshold: false |
| 89 | + publish_only_summary: false |
| 90 | + - name: Print JaCoCo Report |
| 91 | + if: ${{ github.event_name != 'pull_request' }} |
| 92 | + run: | |
| 93 | + echo "| Outcome | Value |" >> $GITHUB_STEP_SUMMARY |
| 94 | + echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY |
| 95 | + echo "| Code Coverage % | ${{ steps.jacoco_reporter.outputs.coverage_percentage }} |" >> $GITHUB_STEP_SUMMARY |
| 96 | + echo "| :heavy_check_mark: Number of Lines Covered | ${{ steps.jacoco_reporter.outputs.covered_lines }} |" >> $GITHUB_STEP_SUMMARY |
| 97 | + echo "| :x: Number of Lines Missed | ${{ steps.jacoco_reporter.outputs.missed_lines }} |" >> $GITHUB_STEP_SUMMARY |
| 98 | + echo "| Total Number of Lines | ${{ steps.jacoco_reporter.outputs.total_lines }} |" >> $GITHUB_STEP_SUMMARY |
| 99 | + - name: Upload Code Coverage Artifacts (Push) |
| 100 | + if: ${{ github.event_name != 'pull_request' }} |
| 101 | + uses: actions/upload-artifact@v4 |
| 102 | + with: |
| 103 | + name: coverage-report |
| 104 | + path: "*/coverage-results.md" |
| 105 | + - name: Upload Code Coverage Artifacts (Pull Request) |
| 106 | + if: ${{ github.event_name == 'pull_request' }} |
| 107 | + |
| 108 | + with: |
| 109 | + paths: build/jacoco.xml |
| 110 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 111 | + pass-emoji: ✅ |
| 112 | + min-coverage-overall: 85 |
| 113 | + min-coverage-changed-files: 90 |
78 | 114 |
|
79 | 115 | deploy:
|
80 | 116 | runs-on: ubuntu-latest
|
|
0 commit comments