Skip to content

Commit b936371

Browse files
committed
added the Sonarcloud configuration
1 parent 58a74d7 commit b936371

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: SonarCloud
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: Build and analyze
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: 17
20+
distribution: 'zulu' # Alternative distribution options are available
21+
- name: Cache SonarCloud packages
22+
uses: actions/cache@v3
23+
with:
24+
path: ~/.sonar/cache
25+
key: ${{ runner.os }}-sonar
26+
restore-keys: ${{ runner.os }}-sonar
27+
- name: Cache Gradle packages
28+
uses: actions/cache@v3
29+
with:
30+
path: ~/.gradle/caches
31+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
32+
restore-keys: ${{ runner.os }}-gradle
33+
- name: Build and analyze
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
36+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37+
run: ./gradlew build sonar --info

javaBuild/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
plugins {
2222
id 'java-library'
2323
id 'maven-publish'
24+
id "org.sonarqube" version "4.4.1.3373"
2425
}
2526

2627

@@ -305,5 +306,13 @@ compileJava.doFirst {
305306

306307
}
307308

309+
sonar {
310+
properties {
311+
property "sonar.projectKey", "bootsfaces_bootsfaces"
312+
property "sonar.organization", "bootsfaces"
313+
property "sonar.host.url", "https://sonarcloud.io"
314+
}
315+
}
316+
308317
defaultTasks 'clean','defaultJar','buildJava11Jar','publishToMavenLocal'
309318
//defaultTasks 'clean','defaultJar','buildJava11Jar','buildJava17Jar','publishToMavenLocal'

0 commit comments

Comments
 (0)