Skip to content

Commit da27a31

Browse files
author
Daniel Bustamante Ospina
committed
Add sonarqube to build (gh actions)
1 parent 5a51055 commit da27a31

File tree

7 files changed

+38
-42
lines changed

7 files changed

+38
-42
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ jobs:
2424
java-version: 1.8
2525
- name: Grant execute permission for gradlew
2626
run: chmod +x gradlew
27-
- name: Execute jacocoTestReport
28-
run: ./gradlew test jacocoTestReport && cp build/reports/jacoco/report.xml jacoco.xml || echo "Code coverage failed"
27+
- name: Execute jacocoTestReport and Sonar
28+
env:
29+
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
30+
run: ./gradlew test jacocoTestReport sonarqube
31+
# run: ./gradlew test jacocoTestReport && cp build/reports/jacoco/report.xml jacoco.xml || echo "Code coverage failed"
2932
- name: Build with Gradle
3033
run: ./gradlew build --refresh-dependencies --no-daemon --continue
31-
- name: Push codeCoverage to Codecov
32-
run: bash <(curl -s https://codecov.io/bash)
34+
# - name: Push codeCoverage to Codecov
35+
# run: bash <(curl -s https://codecov.io/bash)
3336

3437
release:
3538
if: github.event_name == 'release'
@@ -42,12 +45,12 @@ jobs:
4245
java-version: 1.8
4346
- name: Grant execute permission for gradlew
4447
run: chmod +x gradlew
45-
- name: Execute jacocoTestReport
46-
run: ./gradlew test jacocoTestReport && cp build/reports/jacoco/report.xml jacoco.xml || echo "Code coverage failed"
48+
# - name: Execute jacocoTestReport
49+
# run: ./gradlew test jacocoTestReport && cp build/reports/jacoco/report.xml jacoco.xml || echo "Code coverage failed"
4750
- name: Build with Gradle
4851
run: ./gradlew build --refresh-dependencies --no-daemon --continue
49-
- name: Push codeCoverage to Codecov
50-
run: bash <(curl -s https://codecov.io/bash)
52+
# - name: Push codeCoverage to Codecov
53+
# run: bash <(curl -s https://codecov.io/bash)
5154
- name: Echo credentials
5255
run: echo "bintrayUser=${{secrets.BINTRAY_USER}}" >> gradle.properties
5356
- name: Echo credentials Key

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ To include all (API and implementation) (Spring boot Starter):
1313
dependencies {
1414
compile 'org.reactivecommons:async-commons-starter:0.6.0-beta'
1515
}
16+
17+
//IMPORTANT! if you use the version 0.6.0-beta
18+
configurations.all {
19+
resolutionStrategy.eachDependency {DependencyResolveDetails details ->
20+
if (details.requested.group == 'io.projectreactor.rabbitmq'){
21+
details.useVersion('1.5.0-M2')
22+
details.because('Upgrade')
23+
}
24+
}
25+
}
26+
1627
```
1728

1829
To include only domain events API:

async/async-commons-starter/async-commons-starter.gradle

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,3 @@ dependencies {
8080

8181
testImplementation 'io.projectreactor:reactor-test'
8282
}
83-
84-
configurations.all {
85-
86-
resolutionStrategy.eachDependency {DependencyResolveDetails details ->
87-
if (details.requested.group == 'io.projectreactor.rabbitmq'){
88-
details.useVersion('1.5.0-M2')
89-
details.because('Upgrade')
90-
}
91-
}
92-
}

async/async-commons/async-commons.gradle

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,3 @@ dependencies {
8181
testImplementation 'io.projectreactor:reactor-test'
8282
testCompile group: 'com.github.javatlacati', name: 'contiperf', version: '2.4.3'
8383
}
84-
85-
configurations.all {
86-
87-
resolutionStrategy.eachDependency {DependencyResolveDetails details ->
88-
if (details.requested.group == 'io.projectreactor.rabbitmq'){
89-
details.useVersion('1.5.0-M2')
90-
details.because('Upgrade')
91-
}
92-
}
93-
}

build.gradle

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@ buildscript {
1111
}
1212

1313
plugins {
14-
id "org.sonarqube" version "2.6"
14+
id 'jacoco'
15+
id "org.sonarqube" version "3.0"
16+
}
17+
18+
sonarqube {
19+
properties {
20+
property "sonar.projectKey", "reactive-commons_reactive-commons-java"
21+
property "sonar.organization", "reactive-commons"
22+
property "sonar.host.url", "https://sonarcloud.io"
23+
}
1524
}
1625

1726
apply from: './main.gradle'
1827
apply plugin: 'com.github.ben-manes.versions'
19-
20-
configurations.all {
21-
22-
resolutionStrategy.eachDependency {DependencyResolveDetails details ->
23-
if (details.requested.group == 'io.projectreactor.rabbitmq'){
24-
details.useVersion('1.5.0-M2')
25-
details.because('Upgrade')
26-
}
27-
}
28-
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
version=0.6.0-beta
22
springBootVersion=2.2.9.RELEASE
33
gradleVersionsVersion=0.28.0
4+
reactorRabbitVersion=1.5.0-M2

main.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ subprojects {
4040

4141
resolutionStrategy.eachDependency {DependencyResolveDetails details ->
4242
if (details.requested.group == 'io.projectreactor.rabbitmq'){
43-
details.useVersion('1.5.0-M2')
43+
details.useVersion("${reactorRabbitVersion}")
4444
details.because('Upgrade')
4545
}
4646
}
4747
}
4848

4949

50-
jacoco {
51-
toolVersion = '0.8.2'
50+
jacocoTestReport {
51+
reports {
52+
xml.enabled true
53+
}
5254
}
5355

5456
dependencyManagement {

0 commit comments

Comments
 (0)