From 577a876fe0e693b6e89a307d4019981f0a17fac1 Mon Sep 17 00:00:00 2001 From: Rahul Kausale Date: Tue, 3 Dec 2024 09:46:34 +0000 Subject: [PATCH] added SonarQube scan workflow --- .github/workflows/assignment2.yml | 27 +++++++++++++++++++++++++++ pom.xml | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/assignment2.yml diff --git a/.github/workflows/assignment2.yml b/.github/workflows/assignment2.yml new file mode 100644 index 00000000..ec9b23df --- /dev/null +++ b/.github/workflows/assignment2.yml @@ -0,0 +1,27 @@ +name: Java CI with Maven and SonarQube scan + +on: + push: + branches: [ "feature/**" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=rahulkausale_spring-boot-hello-world \ No newline at end of file diff --git a/pom.xml b/pom.xml index 35dc46a5..a9808e0c 100644 --- a/pom.xml +++ b/pom.xml @@ -18,6 +18,8 @@ 1.8 + rahulkausale + https://sonarcloud.io