-
Notifications
You must be signed in to change notification settings - Fork 21.1k
Expand file tree
/
Copy pathsonar.yml
More file actions
37 lines (31 loc) · 895 Bytes
/
sonar.yml
File metadata and controls
37 lines (31 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: SonarQube Scan
on:
push:
branches:
- main
pull_request:
jobs:
sonar:
name: Build and Analyze
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and SonarQube Scan
run: |
mvn clean verify sonar:sonar \
-Dsonar.projectKey=Nglicloud_Java \
-Dsonar.host.url= https://sonarcloud.io/projects \
-Dsonar.login=75f5d23fd39669ae77ea05ba90a303606672ef5a \
-Dsonar.organization=nglicloud