From 3e8cbd603b3e5aeedf474c8cafa59b7b5d86f5b8 Mon Sep 17 00:00:00 2001 From: Christoph-Meyer Date: Fri, 11 Oct 2024 14:00:27 +0200 Subject: [PATCH] SonarCloud --- .github/workflows/sonarquest-ci.yml | 34 ++++++++++++++++++++++++++++- sonarQuest-backend/pom.xml | 5 +++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonarquest-ci.yml b/.github/workflows/sonarquest-ci.yml index b6b94f8d..b9d453fa 100644 --- a/.github/workflows/sonarquest-ci.yml +++ b/.github/workflows/sonarquest-ci.yml @@ -50,7 +50,39 @@ jobs: push: true tags: ghcr.io/viadee/sonarquest-backend:nightly - + sonar-analysis-backend: + name: SonarCloud Analysis + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - app: sonarquest-backend + working-directory: ./backend + jacoco-report-dir: jacoco-report + sonar-project-key: viadee_sonarQuest + sonar-organization: viadee + sonar-host-url: https://sonarcloud.io + continue-on-error: true + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Download JaCoCo Report + uses: actions/download-artifact@master + with: + name: jacoco-report + path: ${{ matrix.jacoco-report-dir }} + - name: Build and analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ + -Dsonar.projectKey=${{ matrix.sonar-project-key }} \ + -Dsonar.organization=${{ matrix.sonar-organization }} \ + -Dsonar.host.url=${{ matrix.sonar-host-url }} \ + -Dsonar.sources=src/main/java,src/main/resources/templates \ + -Dsonar.coverage.jacoco.xmlReportPaths=../${{ matrix.jacoco-report-dir }}/jacoco.xml frontend: runs-on: ubuntu-latest diff --git a/sonarQuest-backend/pom.xml b/sonarQuest-backend/pom.xml index 1891c07c..90d64abb 100644 --- a/sonarQuest-backend/pom.xml +++ b/sonarQuest-backend/pom.xml @@ -23,6 +23,11 @@ http://www.viadee.de + + viadee + https://sonarcloud.io + + https://github.com/viadee/sonarQuest