From 01486f19829b15343ab6ef692f82a05dafa09126 Mon Sep 17 00:00:00 2001 From: Robert Stolz Date: Fri, 27 Dec 2024 12:09:55 +0100 Subject: [PATCH] sonar frontend changed --- .github/workflows/sonar-frontend.yml | 29 ++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sonar-frontend.yml b/.github/workflows/sonar-frontend.yml index 24a340b..677e44d 100644 --- a/.github/workflows/sonar-frontend.yml +++ b/.github/workflows/sonar-frontend.yml @@ -1,4 +1,4 @@ -name: Build +name: SonarQube on: push: branches: @@ -6,15 +6,32 @@ on: pull_request: types: [opened, synchronize, reopened] jobs: - sonarcloud: - name: SonarQube Cloud + build: + name: Build and analyze runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: SonarQube Cloud Scan - uses: SonarSource/sonarcloud-github-action@master + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: 'zulu' # Alternative distribution options are available. + - 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 analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=ropold_MemoryHub-frontend --file frontend/pom.xml \ No newline at end of file