Skip to content

Commit

Permalink
Fix coverage and sonar workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
oranheim committed Oct 4, 2024
1 parent 27ecb18 commit 167fbe1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/coverage-and-sonar-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,7 @@ jobs:
-Dsonar.projectKey=descoped_data-collector-core \
-Dsonar.organization=descoped \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml \
-X -Djacoco.verbose=true
echo "Maven build completed. Checking for Jacoco report:"
ls -l target/site/jacoco/ || echo "Jacoco directory not found"
find . -name "jacoco.xml" || echo "No jacoco.xml found"
- name: Find Jacoco files
run: find . -name "*jacoco*.xml"

- name: Run tests
run: mvn test -P coverage
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco/jacoco.xml
- name: Show test results
if: always()
Expand Down
19 changes: 17 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -307,6 +308,7 @@
<goals>
<goal>report</goal>
</goals>
<phase>test</phase>
<configuration>
<formats>
<format>XML</format>
Expand All @@ -315,6 +317,19 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<!--suppress UnresolvedMavenProperty -->
<argLine>
${argLine}
-XX:+EnableDynamicAgentLoading
-Xmx1500m
</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -326,7 +341,7 @@
<sonar.organization>descoped</sonar.organization>
<sonar.projectKey>descoped_${project.artifactId}</sonar.projectKey>
<sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
<sonar.coverage.exclusions />
<sonar.coverage.exclusions/>
<sonar.coverage.jacoco.xmlReportPaths>
target/site/jacoco/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
Expand Down

0 comments on commit 167fbe1

Please sign in to comment.