Skip to content

Commit ca1b195

Browse files
author
Oryan M
committed
Add sonar to workflow
1 parent 20814e0 commit ca1b195

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

.github/workflows/pull-request.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,12 @@ jobs:
2727
analyze:
2828
runs-on: ubuntu-latest
2929
steps:
30-
- name: Checkout
31-
uses: actions/checkout@v2
32-
- name: Setup java
33-
uses: actions/setup-java@v2
30+
- uses: actions/checkout@v2
3431
with:
35-
java-version: '8'
36-
distribution: 'adopt'
37-
- name: Cache Maven packages
38-
uses: actions/cache@v2
39-
with:
40-
path: ~/.m2
41-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
42-
restore-keys: ${{ runner.os }}-m2
43-
- name: Analyze with SonarCloud
44-
run: mvn -B verify -Psonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
32+
# Disabling shallow clone is recommended for improving relevancy of reporting
33+
fetch-depth: 0
34+
- name: SonarCloud Scan
35+
uses: sonarsource/sonarcloud-github-action@master
4536
env:
4637
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)