Skip to content

Commit 1367b33

Browse files
committed
Added sonar.
1 parent 3ebcb29 commit 1367b33

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.github/workflows/maven.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,22 @@ jobs:
2424
distribution: 'temurin'
2525
java-version: '11'
2626
cache: 'gradle'
27+
- name: Cache SonarCloud packages
28+
uses: actions/cache@v1
29+
with:
30+
path: ~/.sonar/cache
31+
key: ${{ runner.os }}-sonar
32+
restore-keys: ${{ runner.os }}-sonar
2733
- uses: actions/cache@v1
2834
with:
2935
path: ~/.gradle/caches
3036
key: ${{ runner.os }}-gradle
3137
restore-keys: ${{ runner.os }}-gradle
3238
- name: Build with Gradle
33-
run: chmod +x gradlew && ./gradlew test jacocoTestReport
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
SONAR_TOKEN: 19107c464b65c0769768d4564dd1c9b0c2822edd
42+
run: chmod +x gradlew && ./gradlew spotlessJavaCheck test jacocoTestReport sonarqube -Dsonar.projectKey=javadev_LeetCode-in-Kotlin -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=javadev-github --no-daemon
3443
- uses: codecov/codecov-action@v1
3544
with:
3645
file: ./**/build/reports/jacoco/test/jacocoTestReport.xml

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
kotlin("jvm") version "1.6.10"
33
jacoco
4+
org.sonarqube version "3.3"
45
`maven-publish`
56
}
67

0 commit comments

Comments
 (0)