Skip to content

Commit 996b364

Browse files
committed
fix pom and ci
1 parent 5ca0566 commit 996b364

File tree

2 files changed

+22
-60
lines changed

2 files changed

+22
-60
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -68,50 +68,14 @@ jobs:
6868
CX_TENANT: ${{ secrets.CX_TENANT }}
6969
CX_APIKEY: ${{ secrets.CX_APIKEY }}
7070

71-
- name: Print filtered coverage percentage
71+
- name: Print total coverage percentage
7272
run: |
73-
COVERED_LINES=$(xmllint --xpath "sum(//report/package[
74-
not(starts-with(@name, 'com.checkmarx.ast.results')) and
75-
not(starts-with(@name, 'com.checkmarx.ast.kicsRealtimeResults')) and
76-
not(starts-with(@name, 'com.checkmarx.ast.asca')) and
77-
not(starts-with(@name, 'com.checkmarx.ast.learnMore')) and
78-
not(starts-with(@name, 'com.checkmarx.ast.predicate')) and
79-
not(starts-with(@name, 'com.checkmarx.ast.scan')) and
80-
not(starts-with(@name, 'com.checkmarx.ast.codebashing')) and
81-
not(starts-with(@name, 'com.checkmarx.ast.remediation')) and
82-
not(starts-with(@name, 'com.checkmarx.ast.project')) and
83-
not(starts-with(@name, 'com.checkmarx.ast.tenant')) and
84-
not(starts-with(@name, 'com.checkmarx.ast.wrapper.Execution'))
85-
]/counter[@type='LINE']/@covered)" target/site/jacoco/jacoco.xml)
86-
87-
MISSED_LINES=$(xmllint --xpath "sum(//report/package[
88-
not(starts-with(@name, 'com.checkmarx.ast.results')) and
89-
not(starts-with(@name, 'com.checkmarx.ast.kicsRealtimeResults')) and
90-
not(starts-with(@name, 'com.checkmarx.ast.asca')) and
91-
not(starts-with(@name, 'com.checkmarx.ast.learnMore')) and
92-
not(starts-with(@name, 'com.checkmarx.ast.predicate')) and
93-
not(starts-with(@name, 'com.checkmarx.ast.scan')) and
94-
not(starts-with(@name, 'com.checkmarx.ast.codebashing')) and
95-
not(starts-with(@name, 'com.checkmarx.ast.remediation')) and
96-
not(starts-with(@name, 'com.checkmarx.ast.project')) and
97-
not(starts-with(@name, 'com.checkmarx.ast.tenant')) and
98-
not(starts-with(@name, 'com.checkmarx.ast.wrapper.Execution'))
99-
]/counter[@type='LINE']/@missed)" target/site/jacoco/jacoco.xml)
100-
101-
if [ -z "$COVERED_LINES" ] || [ -z "$MISSED_LINES" ]; then
102-
echo "Error: Could not extract coverage data from jacoco.xml"
103-
exit 1
104-
fi
105-
73+
COVERED_LINES=$(xmllint --xpath "string(//report/counter[@type='LINE']/@covered)" target/site/jacoco/jacoco.xml)
74+
MISSED_LINES=$(xmllint --xpath "string(//report/counter[@type='LINE']/@missed)" target/site/jacoco/jacoco.xml)
10675
TOTAL_LINES=$((COVERED_LINES + MISSED_LINES))
107-
108-
if [ "$TOTAL_LINES" -eq 0 ]; then
109-
COVERAGE_PERCENTAGE=0
110-
else
111-
COVERAGE_PERCENTAGE=$(echo "scale=2; $COVERED_LINES / $TOTAL_LINES * 100" | bc)
112-
fi
113-
114-
echo "Filtered coverage percentage: $COVERAGE_PERCENTAGE%"
76+
COVERAGE_PERCENTAGE=$(echo "scale=2; $COVERED_LINES / $TOTAL_LINES * 100" | bc)
77+
echo "Total coverage percentage: $COVERAGE_PERCENTAGE%"
78+
11579

11680

11781

pom.xml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,24 @@
6565
<groupId>org.jacoco</groupId>
6666
<artifactId>jacoco-maven-plugin</artifactId>
6767
<version>0.8.8</version>
68+
<configuration>
69+
<excludes>
70+
<exclude>**/com/checkmarx/ast/results/**</exclude>
71+
<exclude>**/com/checkmarx/ast/kicsRealtimeResults/**</exclude>
72+
<exclude>**/com/checkmarx/ast/asca/**</exclude>
73+
<exclude>**/com/checkmarx/ast/learnMore/**</exclude>
74+
<exclude>**/com/checkmarx/ast/predicate/**</exclude>
75+
<exclude>**/com/checkmarx/ast/scan/**</exclude>
76+
<exclude>**/com/checkmarx/ast/codebashing/**</exclude>
77+
<exclude>**/com/checkmarx/ast/remediation/**</exclude>
78+
<exclude>**/com/checkmarx/ast/project/**</exclude>
79+
<exclude>**/com/checkmarx/ast/tenant/**</exclude>
80+
<exclude>**/com/checkmarx/ast/wrapper/Execution**</exclude>
81+
<!-- Add other patterns as needed -->
82+
</excludes>
83+
</configuration>
6884
<executions>
6985
<execution>
70-
<id>prepare-agent</id>
7186
<goals>
7287
<goal>prepare-agent</goal>
7388
</goals>
@@ -78,23 +93,6 @@
7893
<goals>
7994
<goal>report</goal>
8095
</goals>
81-
<configuration>
82-
<excludes>
83-
<exclude>**/com/checkmarx/ast/results/**</exclude>
84-
<exclude>**/com/checkmarx/ast/kicsRealtimeResults/**</exclude>
85-
<exclude>**/com/checkmarx/ast/asca/**</exclude>
86-
<exclude>**/com/checkmarx/ast/learnMore/**</exclude>
87-
<exclude>**/com/checkmarx/ast/predicate/**</exclude>
88-
<exclude>**/com/checkmarx/ast/scan/**</exclude>
89-
<exclude>**/com/checkmarx/ast/codebashing/**</exclude>
90-
<exclude>**/com/checkmarx/ast/remediation/**</exclude>
91-
<exclude>**/com/checkmarx/ast/project/**</exclude>
92-
<exclude>**/com/checkmarx/ast/tenant/**</exclude>
93-
<exclude>**/com/checkmarx/ast/wrapper/Execution**</exclude>
94-
</excludes>
95-
96-
97-
</configuration>
9896
</execution>
9997
</executions>
10098
</plugin>

0 commit comments

Comments
 (0)