Skip to content

Commit b046e9a

Browse files
committed
Add sonarqube plugin to build
1 parent f6de1ab commit b046e9a

3 files changed

Lines changed: 17 additions & 14 deletions

File tree

.github/workflows/integration.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
name: integration
44

5-
on: [push, pull_request]
5+
on: [ push, pull_request ]
66

77
jobs:
88
build:
@@ -25,9 +25,11 @@ jobs:
2525
~/.gradle/wrapper
2626
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
2727
restore-keys: ${{ runner.os }}-gradle
28-
- name: Build and test
29-
run: |
30-
chmod +x gradlew
31-
./gradlew build --no-daemon
28+
- name: Build and analyze
3229
env:
3330
SEER_API_KEY: ${{ secrets.SEER_API_KEY }}
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
32+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
33+
run: |
34+
chmod +x gradlew
35+
./gradlew build sonarqube

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# seerapi-client-java
2+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=imsweb_seerapi-client-java&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=imsweb_seerapi-client-java)
23
[![integration](https://github.com/imsweb/seerapi-client-java/workflows/integration/badge.svg)](https://github.com/imsweb/seerapi-client-java/actions)
34
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.imsweb/seerapi-client-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.imsweb/seerapi-client-java)
45

build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ plugins {
88
id 'com.adarshr.test-logger' version '3.2.0'
99
id "com.github.ben-manes.versions" version "0.42.0"
1010
id 'org.sonatype.gradle.plugins.scan' version '2.3.0'
11+
id "org.sonarqube" version "3.3"
1112
}
1213

1314
group = 'com.imsweb'
@@ -77,19 +78,18 @@ spotbugs {
7778
excludeFilter = file('config/spotbugs/spotbugs-exclude.xml')
7879
}
7980

81+
sonarqube {
82+
properties {
83+
property "sonar.projectKey", "imsweb_seerapi-client-java"
84+
property "sonar.organization", "imsweb"
85+
property "sonar.host.url", "https://sonarcloud.io"
86+
}
87+
}
88+
8089
// Nexus vulnerability scan (see https://github.com/sonatype-nexus-community/scan-gradle-plugin)
8190
ossIndexAudit {
8291
dependencyGraph = true
8392
printBanner = false
84-
85-
// only set proxy if running outside of Github Actions
86-
if (!System.getenv().GITHUB_ACTIONS) {
87-
proxyConfiguration {
88-
protocol = 'http'
89-
host = 'webproxy-btp.imsweb.com'
90-
port = 8080
91-
}
92-
}
9393
}
9494

9595
wrapper {

0 commit comments

Comments
 (0)