Skip to content

Commit

Permalink
Sonar code anaysis in workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
devops4sure committed Nov 10, 2023
1 parent 22b4f18 commit c1ac159
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,29 @@ jobs:
run: mvn test

- name: Checkstyle
run: mvn checkstyle:checkstyle
run: mvn checkstyle:checkstyle

# Setup java 11 to be default (sonar-scanner requirement as of 5.x)
- name: Set Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '11'

# Setup sonar-scanner
- name: Setup SonarQube
uses: warchant/setup-sonar-scanner@v7

# Run sonar-scanner
- name: SonarQube Scan
run: sonar-scanner
-Dsonar.host.url=${{ secrets.SONAR_URL }}
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.organization=${{ secrets.SONAR_ORGANIZATION }}
-Dsonar.projectKey=${{ secrets.SONAR_PROJECT_KEY }}
-Dsonar.sources=src/
-Dsonar.junit.reportsPath=target/surefire-reports/
-Dsonar.jacoco.reportsPath=target/jacoco.exec
-Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml
-Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/

0 comments on commit c1ac159

Please sign in to comment.