File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Sonar
2
+
3
+ env :
4
+ MAVEN_ARGS : -V -ntp -e
5
+
6
+ concurrency :
7
+ group : ${{ github.ref }}-${{ github.workflow }}
8
+ cancel-in-progress : true
9
+ on :
10
+ push :
11
+ paths-ignore :
12
+ - ' docs/**'
13
+ - ' adr/**'
14
+ branches : [ main ]
15
+ pull_request :
16
+ paths-ignore :
17
+ - ' docs/**'
18
+ - ' adr/**'
19
+ types : [ opened, synchronize, reopened ]
20
+
21
+ jobs :
22
+ test :
23
+ runs-on : ubuntu-latest
24
+ if : ${{ ( github.event_name == 'push' ) || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login == 'kubernetes-glue-operator' ) }}
25
+ steps :
26
+ - uses : actions/checkout@v4
27
+ - name : Set up Java and Maven
28
+ uses : actions/setup-java@v4
29
+ with :
30
+ distribution : temurin
31
+ java-version : 17
32
+ cache : ' maven'
33
+ - name : Cache SonarCloud packages
34
+ uses : actions/cache@v4
35
+ with :
36
+ path : ~/.sonar/cache
37
+ key : ${{ runner.os }}-sonar
38
+ restore-keys : ${{ runner.os }}-sonar
39
+ - name : Build and analyze
40
+ env :
41
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
42
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
43
+ run : mvn -B org.jacoco:jacoco-maven-plugin:prepare-agent clean install verify org.jacoco:jacoco-maven-plugin:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=java-operator-sdk_kubernetes-glue-operator
44
+
Original file line number Diff line number Diff line change 15
15
<maven .compiler.target>${java.version} </maven .compiler.target>
16
16
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
17
17
<surefire-plugin .version>3.5.2</surefire-plugin .version>
18
+ <sonar .organization>java-operator-sdk</sonar .organization>
19
+ <sonar .host.url>https://sonarcloud.io</sonar .host.url>
18
20
<fabric8-client .version>6.13.1</fabric8-client .version>
19
21
<quarkus .version>3.8.3</quarkus .version>
20
22
<graalvm .version>24.1.1</graalvm .version>
You can’t perform that action at this time.
0 commit comments