From 1a193e0ed2314f5ffe597778ccc22eed0688e7a0 Mon Sep 17 00:00:00 2001 From: adhl-0216 <113506757+adhl-0216@users.noreply.github.com> Date: Thu, 3 Apr 2025 21:19:55 +0000 Subject: [PATCH] Update sonarcloud.yml [skip ci] --- .github/workflows/sonarcloud.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index e08b275e1..305dabaea 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -13,43 +13,36 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - + fetch-depth: 0 - name: Set up JDK 17 uses: actions/setup-java@v4 with: java-version: 17 distribution: 'zulu' - - name: Cache SonarQube packages uses: actions/cache@v4 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build and Test with Coverage env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: mvn -B verify jacoco:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=adhl-0216_MTU-DevOps-spring-petclinic - - name: Check Code Coverage run: | - # Extract coverage percentage from JaCoCo report COVERAGE=$(mvn jacoco:report -q -Dquiet=true && grep -oP '(?<=