1- # This is a basic workflow to help you get started with Actions #6
2-
31name : CI-TWO
42
5- # Controls when the workflow will run
63on :
7- # Triggers the workflow on push or pull request events but only for the main branch
84 push :
95 branches : [ main ]
106 pull_request :
117 branches : [ main ]
12-
13- # Allows you to run this workflow manually from the Actions tab
148 workflow_dispatch :
159
16- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
1710jobs :
1811 build :
1912 runs-on : ubuntu-latest
13+ defaults :
14+ run :
15+ working-directory : jacoco-playground
2016 steps :
21- - uses : actions/checkout@v6
17+ - uses : actions/checkout@v4
18+
2219 - name : Set up JDK 17
2320 uses : actions/setup-java@v5.2.0
2421 with :
@@ -31,51 +28,38 @@ jobs:
3128 - name : Run Coverage
3229 run : ./gradlew testCoverage
3330
34-
3531 - name : Jacoco Report to PR
3632 id : jacoco
3733 uses : madrapps/jacoco-report@v1.7.2
3834 with :
39- paths : ${{ github.workspace }}/build/reports/jacoco/testCoverage/testCoverage.xml
35+ paths : ${{ github.workspace }}/jacoco-playground/ build/reports/jacoco/testCoverage/testCoverage.xml
4036 token : ${{ secrets.GITHUB_TOKEN }}
4137 min-coverage-overall : 40
4238 min-coverage-changed-files : 60
4339 debug-mode : false
44-
40+
4541 - name : JaCoCo Code Coverage Report
4642 id : jacoco_reporter
4743 uses : PavanMudigonda/jacoco-reporter@v5.1
4844 with :
49- coverage_results_path : ${{ github.workspace }}/build/reports/jacoco/testCoverage/testCoverage.xml
45+ coverage_results_path : ${{ github.workspace }}/jacoco-playground/ build/reports/jacoco/testCoverage/testCoverage.xml
5046 coverage_report_name : Coverage
5147 coverage_report_title : JaCoCo
5248 github_token : ${{ secrets.GITHUB_TOKEN }}
53- skip_check_run : true # set to false to publish check run
49+ skip_check_run : true
5450 minimum_coverage : 80
55- fail_below_threshold : false # set to false to pass below even when threshold is not met
56- publish_only_summary : false. # set to true to publish only summary to avoid 65k problem
51+ fail_below_threshold : false
52+ publish_only_summary : false
5753
58- # Publish Coverage Job Summary # Optional
5954 - name : Add Coverage Job Summary
6055 run : echo "${{ steps.jacoco_reporter.outputs.coverageSummary }}" >> $GITHUB_STEP_SUMMARY
61-
56+
6257 - name : Get the Coverage info
6358 run : |
6459 echo "Total coverage coverage-overall ${{ steps.jacoco.outputs.coverage-overall }}"
6560 echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
66- echo "Coverage coverage_percentage ${{ steps.jacoco.outputs.coverage_percentage }}"
67-
68- # - name: construct coverage job summary markdown
69- # run: |
70- # cat > coverage_summary.md <<EOF
71- # | Code Coverage Summary | Value |
72- # |--------------------------------------------|----------------------------------------------------------|
73- # | Code Coverage % | ${{ steps.jacoco_reporter.outputs.coverage_percentage }} |
74- # | :heavy_check_mark: Number of Lines Covered | ${{ steps.jacoco_reporter.outputs.covered_lines }} |
75- # | :x: Number of Lines Missed | ${{ steps.jacoco_reporter.outputs.missed_lines }} |
76- # | Total Number of Lines | ${{ steps.jacoco_reporter.outputs.total_lines }} |
77- # EOF
78- # cat coverage_summary.md >> $GITHUB_STEP_SUMMARY
79-
80- - name : print output
81- run : echo "${{ steps.jacoco_reporter.outputs.coverageSummary }}" >> $GITHUB_STEP_SUMMARY
61+ echo "coverage_percentage : ${{ steps.jacoco_reporter.outputs.coverage_percentage }}"
62+ echo "coveragePercentageString : ${{ steps.jacoco_reporter.outputs.coveragePercentageString }}"
63+ echo "covered_lines : ${{ steps.jacoco_reporter.outputs.covered_lines }}"
64+ echo "missed_lines : ${{ steps.jacoco_reporter.outputs.missed_lines }}"
65+ echo "total_lines : ${{ steps.jacoco_reporter.outputs.total_lines }}"
0 commit comments