File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,10 @@ name: build
5
5
6
6
on :
7
7
push :
8
+ branches : [ master ]
8
9
pull_request :
9
10
branches : [ master ]
11
+ types : [opened, synchronize, reopened]
10
12
11
13
jobs :
12
14
build :
36
38
run : |
37
39
curl -Ls https://sh.jbang.dev | bash -s - app setup
38
40
~/.jbang/bin/jbang .github/VersionLibraryVerifier.java amadeus-java/
41
+
42
+ sonarbuild :
43
+ name : sonarcloud Build
44
+ runs-on : ubuntu-latest
45
+ steps :
46
+ - uses : actions/checkout@v2
47
+ with :
48
+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
49
+ - name : Set up JDK 11
50
+ uses : actions/setup-java@v1
51
+ with :
52
+ java-version : 11
53
+ - name : Cache SonarCloud packages
54
+ uses : actions/cache@v1
55
+ with :
56
+ path : ~/.sonar/cache
57
+ key : ${{ runner.os }}-sonar
58
+ restore-keys : ${{ runner.os }}-sonar
59
+ - name : Cache Gradle packages
60
+ uses : actions/cache@v1
61
+ with :
62
+ path : ~/.gradle/caches
63
+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
64
+ restore-keys : ${{ runner.os }}-gradle
65
+ - name : Build and analyze
66
+ env :
67
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
68
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
69
+ run : ./gradlew build sonarqube --info
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ plugins {
4
4
id ' checkstyle'
5
5
id ' com.vanniktech.maven.publish' version ' 0.18.0'
6
6
id ' jacoco'
7
+ id " org.sonarqube" version " 3.4.0.2513"
7
8
}
8
9
9
10
compileJava {
@@ -80,3 +81,11 @@ signing {
80
81
useInMemoryPgpKeys(project. getProperty(' SIGNING_PRIVATE_KEY' ), project. getProperty(' SIGNING_PASSWORD' ))
81
82
}
82
83
}
84
+
85
+ sonarqube {
86
+ properties {
87
+ property " sonar.projectKey" , " amadeus4dev_amadeus-java"
88
+ property " sonar.organization" , " amadeus4dev"
89
+ property " sonar.host.url" , " https://sonarcloud.io"
90
+ }
91
+ }
You can’t perform that action at this time.
0 commit comments