Skip to content

Commit

Permalink
added SonarQube scan workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahul Kausale committed Dec 3, 2024
1 parent caaed26 commit 577a876
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/assignment2.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

<properties>
<java.version>1.8</java.version>
<sonar.organization>rahulkausale</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

<dependencies>
Expand Down

0 comments on commit 577a876

Please sign in to comment.