Use sonarcloud
This commit is contained in:
11
.github/workflows/tests.yml
vendored
11
.github/workflows/tests.yml
vendored
@@ -101,6 +101,17 @@ jobs:
|
|||||||
arguments: coveralls
|
arguments: coveralls
|
||||||
env:
|
env:
|
||||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||||
|
- name: Cache SonarCloud packages
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ~/.sonar/cache
|
||||||
|
key: ${{ runner.os }}-sonar
|
||||||
|
restore-keys: ${{ runner.os }}-sonar
|
||||||
|
- name: Build and analyze
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
run: ./gradlew build sonarqube --info
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
needs: build
|
needs: build
|
||||||
|
|||||||
5
.idea/runConfigurations/Sonarqube.xml
generated
5
.idea/runConfigurations/Sonarqube.xml
generated
@@ -1,6 +1,11 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Sonarqube" type="GradleRunConfiguration" factoryName="Gradle">
|
<configuration default="false" name="Sonarqube" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
<ExternalSystemSettings>
|
<ExternalSystemSettings>
|
||||||
|
<option name="env">
|
||||||
|
<map>
|
||||||
|
<entry key="SONAR_TOKEN" value="15ad34f46763706727d884ced12c48d5222fe639" />
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
<option name="executionName" />
|
<option name="executionName" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="externalSystemIdString" value="GRADLE" />
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
# DC Project
|
# DC Project
|
||||||
|
|
||||||
[](https://www.codefactor.io/repository/github/flecomte/dc-project)
|
[](https://www.codefactor.io/repository/github/flecomte/dc-project)
|
||||||
|
[](https://www.codacy.com/gh/flecomte/dc-project/dashboard?utm_source=github.com&utm_medium=referral&utm_content=flecomte/dc-project&utm_campaign=Badge_Grade)
|
||||||
|
[](https://sonarcloud.io/dashboard?id=dc-project)
|
||||||
|
|
||||||
[](https://github.com/flecomte/dc-project/actions/workflows/tests.yml)
|
[](https://github.com/flecomte/dc-project/actions/workflows/tests.yml)
|
||||||
[](https://coveralls.io/github/flecomte/dc-project?branch=master)
|
[](https://coveralls.io/github/flecomte/dc-project?branch=master)
|
||||||
[](https://www.codacy.com/gh/flecomte/dc-project/dashboard?utm_source=github.com&utm_medium=referral&utm_content=flecomte/dc-project&utm_campaign=Badge_Grade)
|
[](https://sonarcloud.io/dashboard?id=dc-project)
|
||||||
|
|
||||||
|
[](https://sonarcloud.io/dashboard?id=dc-project)
|
||||||
|
|
||||||
[Installation](./doc/installation/Installation.md)
|
[Installation](./doc/installation/Installation.md)
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,11 @@ tasks.named<ShadowJar>("shadowJar") {
|
|||||||
archiveFileName.set("${archiveBaseName.get()}-latest-all.${archiveExtension.get()}")
|
archiveFileName.set("${archiveBaseName.get()}-latest-all.${archiveExtension.get()}")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.sonarqube.configure { dependsOn(tasks.jacocoTestReport) }
|
tasks.sonarqube.configure {
|
||||||
|
dependsOn(tasks.test)
|
||||||
|
dependsOn(tasks.detekt)
|
||||||
|
dependsOn(tasks.jacocoTestReport)
|
||||||
|
}
|
||||||
|
|
||||||
val sourcesJar by tasks.registering(Jar::class) {
|
val sourcesJar by tasks.registering(Jar::class) {
|
||||||
group = "build"
|
group = "build"
|
||||||
@@ -233,17 +237,7 @@ dockerCompose {
|
|||||||
stopContainers = false
|
stopContainers = false
|
||||||
isRequiredBy(project.tasks.test)
|
isRequiredBy(project.tasks.test)
|
||||||
}
|
}
|
||||||
|
|
||||||
createNested("sonarqube").apply {
|
|
||||||
projectName = "dc-project"
|
|
||||||
useComposeFiles = listOf("docker-compose-sonar.yml")
|
|
||||||
stopContainers = false
|
|
||||||
removeVolumes = false
|
|
||||||
removeContainers = false
|
|
||||||
// isRequiredBy(project.tasks.sonarqube)
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
tasks.sonarqube.configure { dependsOn(tasks.named("sonarqubeComposeUp")) }
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
if (versioning.info.dirty == false) {
|
if (versioning.info.dirty == false) {
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
version: '3.8'
|
|
||||||
services:
|
|
||||||
sonarqube:
|
|
||||||
container_name: ${APP_NAME}_sonarqube
|
|
||||||
image: sonarqube:community
|
|
||||||
depends_on:
|
|
||||||
- sonarqube_db
|
|
||||||
ports:
|
|
||||||
- ${SONARQUBE_PORT}:9000
|
|
||||||
networks:
|
|
||||||
- sonarnet
|
|
||||||
environment:
|
|
||||||
SONAR_JDBC_URL: jdbc:postgresql://sonarqube_db:5432/sonar
|
|
||||||
SONAR_JDBC_USERNAME: sonar
|
|
||||||
SONAR_JDBC_PASSWORD: sonar
|
|
||||||
volumes:
|
|
||||||
- sonarqube_data:/opt/sonarqube/data
|
|
||||||
- sonarqube_extensions:/opt/sonarqube/extensions
|
|
||||||
- sonarqube_logs:/opt/sonarqube/logs
|
|
||||||
- sonarqube_temp:/opt/sonarqube/temp
|
|
||||||
|
|
||||||
sonarqube_db:
|
|
||||||
container_name: ${APP_NAME}_sonarqube_db
|
|
||||||
image: postgres:alpine
|
|
||||||
networks:
|
|
||||||
- sonarnet
|
|
||||||
environment:
|
|
||||||
POSTGRES_USER: sonar
|
|
||||||
POSTGRES_PASSWORD: sonar
|
|
||||||
ports:
|
|
||||||
- ${SONARQUBE_DB_PORT}:5432
|
|
||||||
volumes:
|
|
||||||
- sonarqube_postgresql:/var/lib/postgresql
|
|
||||||
# This needs explicit mapping due to https://github.com/docker-library/postgres/blob/4e48e3228a30763913ece952c611e5e9b95c8759/Dockerfile.template#L52
|
|
||||||
- sonarqube_postgresql_data:/var/lib/postgresql/data
|
|
||||||
|
|
||||||
|
|
||||||
networks:
|
|
||||||
sonarnet:
|
|
||||||
driver: bridge
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
sonarqube_data:
|
|
||||||
sonarqube_extensions:
|
|
||||||
sonarqube_logs:
|
|
||||||
sonarqube_temp:
|
|
||||||
sonarqube_postgresql:
|
|
||||||
sonarqube_postgresql_data:
|
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
systemProp.sonar.host.url=http://localhost:9002
|
systemProp.sonar.host.url=https://sonarcloud.io
|
||||||
systemProp.sonar.login=admin
|
|
||||||
systemProp.sonar.password=sonar
|
|
||||||
systemProp.sonar.projectKey=dc-project
|
systemProp.sonar.projectKey=dc-project
|
||||||
systemProp.sonar.projectName=DC Project
|
systemProp.sonar.projectName=DC Project
|
||||||
|
systemProp.sonar.organization=flecomte
|
||||||
systemProp.sonar.java.coveragePlugin=jacoco
|
systemProp.sonar.java.coveragePlugin=jacoco
|
||||||
systemProp.sonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml
|
systemProp.sonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml
|
||||||
systemProp.sonar.kotlin.detekt.reportPaths=build/reports/detekt/detekt.xml
|
|
||||||
|
|||||||
Reference in New Issue
Block a user