Skip to content

Commit

Permalink
Merge pull request #78 from Hoang-Nguyen-Huy/feat/CI-CD-1
Browse files Browse the repository at this point in the history
[HoangHN] refactor: 🌏 add code coverage pluggin
  • Loading branch information
Hoang-Nguyen-Huy authored Oct 13, 2024
2 parents 8bf86f2 + 0dffb7a commit fe055ad
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Hoang-Nguyen-Huy_pod-booking-system-server
run: mvn -B verify org.jacoco:jacoco-maven-plugin:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=Hoang-Nguyen-Huy_pod-booking-system-server

- name: Display surefire test report
run: cat target/surefire-reports/*.txt
Expand Down
25 changes: 25 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
<sonar.organization>swp-pod-booking-system-server</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -162,6 +163,30 @@
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit fe055ad

Please sign in to comment.