Skip to content

Commit dd935c5

Browse files
authored
Merge pull request #34 from imsweb/add-sonarqube
Add Sonarqube analysis
2 parents f6de1ab + 2689744 commit dd935c5

3 files changed

Lines changed: 18 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: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
plugins {
22
id 'java-library'
33
id 'checkstyle'
4+
id 'jacoco'
45
id "com.github.spotbugs" version "5.0.7"
56
id 'maven-publish'
67
id 'signing'
78
id "io.codearte.nexus-staging" version "0.30.0"
89
id 'com.adarshr.test-logger' version '3.2.0'
910
id "com.github.ben-manes.versions" version "0.42.0"
1011
id 'org.sonatype.gradle.plugins.scan' version '2.3.0'
12+
id "org.sonarqube" version "3.3"
1113
}
1214

1315
group = 'com.imsweb'
@@ -77,19 +79,18 @@ spotbugs {
7779
excludeFilter = file('config/spotbugs/spotbugs-exclude.xml')
7880
}
7981

82+
sonarqube {
83+
properties {
84+
property "sonar.projectKey", "imsweb_seerapi-client-java"
85+
property "sonar.organization", "imsweb"
86+
property "sonar.host.url", "https://sonarcloud.io"
87+
}
88+
}
89+
8090
// Nexus vulnerability scan (see https://github.com/sonatype-nexus-community/scan-gradle-plugin)
8191
ossIndexAudit {
8292
dependencyGraph = true
8393
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-
}
9394
}
9495

9596
wrapper {

0 commit comments

Comments
 (0)