From d68fc210e8f0bf6349831bbe346c5c054dc5855a Mon Sep 17 00:00:00 2001 From: bmunguli Date: Wed, 21 Feb 2024 15:58:05 +0100 Subject: [PATCH] ci: add ci analysis for sonar cloud --- .github/workflows/build-snapshot.yml | 16 +++++++++++++- pom.xml | 32 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-snapshot.yml b/.github/workflows/build-snapshot.yml index fa9ef42d..2cecd0af 100644 --- a/.github/workflows/build-snapshot.yml +++ b/.github/workflows/build-snapshot.yml @@ -39,13 +39,27 @@ jobs: packages: write steps: - uses: actions/checkout@v3 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'adopt' cache: maven + - name: Cache SonarCloud packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Build and Deploy with Maven run: mvn clean -X install env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: SonarCloud Code Analysis + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify --batch-mode sonar:sonar \ No newline at end of file diff --git a/pom.xml b/pom.xml index 43e08140..4fe2dca3 100644 --- a/pom.xml +++ b/pom.xml @@ -98,9 +98,20 @@ 3.24.2 5.9.3 + 0.8.11 + + + 3.10.0.2594 + 3.8.1 + + + + eclipse-tractusx + eclipse-tractusx_sldt-digital-twin-registry + https://sonarcloud.io @@ -405,6 +416,27 @@ + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + + prepare-agent + + + + report + test + + report + + + + +