mirror of https://github.com/halo-dev/halo
Integrate with SonarCloud
parent
b04496e4f3
commit
08898bf100
|
@ -33,6 +33,12 @@ jobs:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
cache: 'gradle'
|
cache: 'gradle'
|
||||||
java-version: 17
|
java-version: 17
|
||||||
|
- name: Cache SonarCloud packages
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ~/.sonar/cache
|
||||||
|
key: ${{ runner.os }}-sonar
|
||||||
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
- uses: dorny/paths-filter@v2
|
- uses: dorny/paths-filter@v2
|
||||||
id: changes
|
id: changes
|
||||||
with:
|
with:
|
||||||
|
@ -43,6 +49,11 @@ jobs:
|
||||||
run: ./gradlew check
|
run: ./gradlew check
|
||||||
- name: Upload coverage reports to Codecov
|
- name: Upload coverage reports to Codecov
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
|
- name: Analyze code
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
run: ./gradlew sonar --info
|
||||||
- name: Setup console environment
|
- name: Setup console environment
|
||||||
if: steps.changes.outputs.console == 'true'
|
if: steps.changes.outputs.console == 'true'
|
||||||
uses: halo-sigs/actions/admin-env-setup@main
|
uses: halo-sigs/actions/admin-env-setup@main
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'java-library'
|
id 'java-library'
|
||||||
id 'halo.publish'
|
id 'halo.publish'
|
||||||
|
id 'jacoco'
|
||||||
id "io.freefair.lombok" version "8.4"
|
id "io.freefair.lombok" version "8.4"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,4 +81,12 @@ java {
|
||||||
|
|
||||||
tasks.named('test') {
|
tasks.named('test') {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
|
finalizedBy jacocoTestReport
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.named('jacocoTestReport') {
|
||||||
|
reports {
|
||||||
|
xml.required = true
|
||||||
|
html.required = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
plugins {
|
||||||
|
id "org.sonarqube" version "4.4.1.3373"
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "run.halo.app"
|
||||||
|
|
||||||
|
sonar {
|
||||||
|
properties {
|
||||||
|
property "sonar.projectKey", "halo-dev_halo"
|
||||||
|
property "sonar.organization", "halo-dev"
|
||||||
|
property "sonar.host.url", "https://sonarcloud.io"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue