Skip to content

Commit 3dfbfab

Browse files
committed
sonar info addedd
1 parent af1d9d1 commit 3dfbfab

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/sonar.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: SonarQube Scan
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
sonar:
11+
name: Build and Analyze
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up JDK 17
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '17'
22+
distribution: 'temurin'
23+
24+
- name: Cache Maven packages
25+
uses: actions/cache@v4
26+
with:
27+
path: ~/.m2
28+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
29+
restore-keys: ${{ runner.os }}-m2
30+
31+
- name: Build and SonarQube Scan
32+
run: |
33+
mvn clean verify sonar:sonar \
34+
-Dsonar.projectKey=Nglicloud_Java \
35+
-Dsonar.host.url= https://sonarcloud.io/projects \
36+
-Dsonar.login=75f5d23fd39669ae77ea05ba90a303606672ef5a \
37+
-Dsonar.organization=nglicloud

0 commit comments

Comments
 (0)