Skip to content

Commit c15e74f

Browse files
Finalize PR and merge check workflows with proper coverage validation
Co-authored-by: devops-thiago <2332561+devops-thiago@users.noreply.github.com>
1 parent 4d2e2b9 commit c15e74f

4 files changed

Lines changed: 27 additions & 24 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,8 @@ jobs:
2828
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
2929
restore-keys: ${{ runner.os }}-m2
3030

31-
- name: Run tests
32-
run: mvn clean test -Dmaven.test.failure.ignore=true
33-
34-
- name: Check code coverage
35-
run: mvn jacoco:check
36-
37-
- name: Generate coverage report
38-
run: mvn jacoco:report
31+
- name: Run tests and verify coverage (80% required)
32+
run: mvn clean verify -Dmaven.test.failure.ignore=true
3933

4034
- name: Upload coverage reports to Codecov
4135
uses: codecov/codecov-action@v4

.github/workflows/merge-checks.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,8 @@ jobs:
2828
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
2929
restore-keys: ${{ runner.os }}-m2
3030

31-
- name: Run tests
32-
run: mvn clean test -Dmaven.test.failure.ignore=true
33-
34-
- name: Generate coverage report
35-
run: mvn jacoco:report
36-
37-
- name: Check code coverage threshold (80%)
38-
run: mvn jacoco:check
31+
- name: Run tests and verify coverage (80% required)
32+
run: mvn clean verify -Dmaven.test.failure.ignore=true
3933

4034
- name: Upload coverage to Codecov
4135
uses: codecov/codecov-action@v4

.github/workflows/pr-checks.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,8 @@ jobs:
2828
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
2929
restore-keys: ${{ runner.os }}-m2
3030

31-
- name: Run tests
32-
run: mvn clean test -Dmaven.test.failure.ignore=true
33-
34-
- name: Generate coverage report
35-
run: mvn jacoco:report
36-
37-
- name: Check code coverage threshold (80%)
38-
run: mvn jacoco:check
31+
- name: Run tests and verify coverage (80% required)
32+
run: mvn clean verify -Dmaven.test.failure.ignore=true
3933

4034
- name: Upload coverage to Codecov
4135
uses: codecov/codecov-action@v4

pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,27 @@
130130
</rules>
131131
</configuration>
132132
</execution>
133+
<execution>
134+
<id>check-coverage</id>
135+
<phase>verify</phase>
136+
<goals>
137+
<goal>check</goal>
138+
</goals>
139+
<configuration>
140+
<rules>
141+
<rule>
142+
<element>BUNDLE</element>
143+
<limits>
144+
<limit>
145+
<counter>INSTRUCTION</counter>
146+
<value>COVEREDRATIO</value>
147+
<minimum>0.80</minimum>
148+
</limit>
149+
</limits>
150+
</rule>
151+
</rules>
152+
</configuration>
153+
</execution>
133154
</executions>
134155
</plugin>
135156

0 commit comments

Comments
 (0)