Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 3e8cbd6

Browse files
SonarCloud
1 parent 07d5666 commit 3e8cbd6

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/sonarquest-ci.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,39 @@ jobs:
5050
push: true
5151
tags: ghcr.io/viadee/sonarquest-backend:nightly
5252

53-
53+
sonar-analysis-backend:
54+
name: SonarCloud Analysis
55+
runs-on: ubuntu-latest
56+
57+
strategy:
58+
matrix:
59+
include:
60+
- app: sonarquest-backend
61+
working-directory: ./backend
62+
jacoco-report-dir: jacoco-report
63+
sonar-project-key: viadee_sonarQuest
64+
sonar-organization: viadee
65+
sonar-host-url: https://sonarcloud.io
66+
continue-on-error: true
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v4
70+
with:
71+
fetch-depth: 0
72+
- name: Download JaCoCo Report
73+
uses: actions/download-artifact@master
74+
with:
75+
name: jacoco-report
76+
path: ${{ matrix.jacoco-report-dir }}
77+
- name: Build and analyze
78+
env:
79+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
80+
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
81+
-Dsonar.projectKey=${{ matrix.sonar-project-key }} \
82+
-Dsonar.organization=${{ matrix.sonar-organization }} \
83+
-Dsonar.host.url=${{ matrix.sonar-host-url }} \
84+
-Dsonar.sources=src/main/java,src/main/resources/templates \
85+
-Dsonar.coverage.jacoco.xmlReportPaths=../${{ matrix.jacoco-report-dir }}/jacoco.xml
5486

5587
frontend:
5688
runs-on: ubuntu-latest

sonarQuest-backend/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
<url>http://www.viadee.de</url>
2424
</organization>
2525

26+
<properties>
27+
<sonar.organization>viadee</sonar.organization>
28+
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
29+
</properties>
30+
2631
<url>https://github.com/viadee/sonarQuest</url>
2732

2833
<parent>

0 commit comments

Comments
 (0)