Skip to content

Commit 491324b

Browse files
PR and master coverage comparison (#140)
Added steps and baseline input to introduce PR and master code coverage comparison.
1 parent d382f16 commit 491324b

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.github/workflows/check-jacoco.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,41 @@ jobs:
3939
- name: Build and run tests
4040
run: mvn clean verify -Pcode-coverage,scala-${{ matrix.scala }} --no-transfer-progress
4141

42+
- name: Upload Jacoco report as workflow artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: PR jacoco report xml ${{ matrix.scala }}
46+
path: target/site/jacoco/jacoco.xml
47+
48+
- name: Checkout master branch into separate folder
49+
uses: actions/checkout@v4
50+
with:
51+
ref: master
52+
path: master_code
53+
- name: Build and run tests (master branch)
54+
working-directory: master_code
55+
run: mvn clean verify -Pcode-coverage,scala-${{ matrix.scala }} --no-transfer-progress
56+
57+
- name: Upload Jacoco report as workflow artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: Master jacoco report xml ${{ matrix.scala }}
61+
path: master_code/target/site/jacoco/jacoco.xml
62+
4263
- uses: actions/setup-python@v5
4364
with:
4465
python-version: '3.12'
45-
4666
- name: Add JaCoCo Report in PR comments
4767
id: jacoco
48-
uses: MoranaApps/jacoco-report@v0.2.1
68+
uses: MoranaApps/jacoco-report@v1.3.0
4969
with:
5070
token: '${{ secrets.GITHUB_TOKEN }}'
5171
paths: |
5272
**/target/site/jacoco/jacoco.xml
73+
exclude-paths: |
74+
master_code/**
75+
baseline-paths: |
76+
master_code/**/target/site/jacoco/jacoco.xml
5377
title: JaCoCo code coverage report - Scala ${{ matrix.scala }}
5478
sensitivity: "detail"
5579
comment-mode: 'single'

0 commit comments

Comments
 (0)