diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml
index 665a8127c..1e40ef15c 100644
--- a/.github/workflows/build-and-publish.yml
+++ b/.github/workflows/build-and-publish.yml
@@ -15,6 +15,9 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
+ with:
+ # Disabling shallow clone is recommended for improving relevancy of reporting
+ fetch-depth: 0
- name: Set up Java 17
uses: actions/setup-java@v1.4.3
@@ -42,3 +45,9 @@ jobs:
- name: Build SHOGun with Maven and publish artifacts to nexus
run: mvn -B deploy
+
+ - name: Scan for unit tests
+ run: mvn clean verify sonar:sonar -Dsonar.projectKey=SHOGun -Dsonar.login="${{ secrets.SONARQUBE_TOKEN }}" -Preporting
+
+ - name: Refresh SonarQube
+ run: mvn compile sonar:sonar -Dsonar.projectKey=SHOGun -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} -Dsonar.login="${{ secrets.SONARQUBE_TOKEN }}"
diff --git a/pom.xml b/pom.xml
index 734418f08..8327d4aaa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -90,8 +90,11 @@
+
+ https://sq.terrestris.de
+ terrestris
+ src/main/
UTF-8
-
17
@@ -147,11 +150,17 @@
3.3.0
3.2.1
0.23.1
+ 3.9.1.2184
+
+ org.sonarsource.scanner.maven
+ sonar-maven-plugin
+ ${sonar-maven-plugin.version}
+
org.apache.maven.plugins
maven-dependency-plugin
@@ -269,6 +278,26 @@
org.apache.maven.plugins
maven-deploy-plugin
+
+ org.jacoco
+ jacoco-maven-plugin
+ ${jacoco-plugin.version}
+
+
+ prepare-agent
+
+ prepare-agent
+
+
+
+ report
+ test
+
+ report
+
+
+
+