Skip to content

Commit ba72daf

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

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/pull-request.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,20 @@ jobs:
2727
analyze:
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v2
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
- name: Setup java
33+
uses: actions/setup-java@v2
3134
with:
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
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 clean verify sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
3645
env:
3746
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)