Skip to content

Commit 42b21bc

Browse files
authored
Merge pull request #5 from xenit-eu/ACC-1443
Add CI/jacoco/sonar
2 parents 0978187 + 01c41c4 commit 42b21bc

File tree

6 files changed

+71
-6
lines changed

6 files changed

+71
-6
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: build
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- uses: actions/setup-java@v4
14+
with:
15+
java-version: 17
16+
distribution: temurin
17+
cache: 'gradle'
18+
- name: Build and Test
19+
run: ./gradlew check --info
20+
- name: Sonar Analysis
21+
run: ./gradlew jacocoTestReport sonar --info
22+
if: env.SONAR_TOKEN != null
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
plugins {
22
id 'java-library'
33
id 'io.freefair.lombok' version '8.6'
4+
id 'jacoco'
5+
id 'org.sonarqube'
46
}
57

68
java {
@@ -9,6 +11,20 @@ java {
911
}
1012
}
1113

14+
jacocoTestReport {
15+
reports {
16+
xml.required = true
17+
}
18+
}
19+
20+
sonarqube {
21+
properties {
22+
property "sonar.projectKey", "xenit-eu_java-hateoas-hal-client"
23+
property "sonar.organization", "xenit-eu"
24+
property "sonar.host.url", "https://sonarcloud.io"
25+
}
26+
}
27+
1228
test {
1329
useJUnitPlatform()
1430
}

lombok.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
config.stopBubbling = true
2+
lombok.addLombokGeneratedAnnotation = true
3+
lombok.nonnull.exceptiontype = IllegalArgumentException
4+
lombok.anyConstructor.addConstructorProperties=true

settings.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
pluginManagement {
2+
plugins {
3+
id 'org.ajoberstar.grgit' version '5.2.2'
4+
id 'org.sonarqube' version '5.0.0.4638'
5+
}
6+
}
7+
8+
plugins {
9+
id 'org.ajoberstar.reckon.settings' version '0.18.3'
10+
id 'eu.xenit.enterprise-conventions.oss' version '0.5.1'
11+
}
12+
13+
dependencyResolutionManagement {
14+
repositories {
15+
mavenCentral()
16+
}
17+
}
18+
19+
reckon {
20+
defaultInferredScope = 'patch'
21+
snapshots()
22+
scopeCalc = calcScopeFromCommitMessages()
23+
stageCalc = { inventory, targetNormal -> java.util.Optional.empty() }
24+
}
25+
26+
rootProject.name = 'java-hal-client'

src/main/java/com/contentgrid/hateoas/client/hal/HalLink.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
1212
public class HalLink {
1313

14-
@Getter
1514
@NonNull
1615
String href;
1716

src/test/java/com/contentgrid/hateoas/client/hal/DefaultHalClientTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@
33
import static org.assertj.core.api.Assertions.assertThat;
44
import static org.assertj.core.api.Assertions.assertThatThrownBy;
55

6-
import java.io.IOException;
76
import java.net.URI;
87
import java.nio.charset.StandardCharsets;
98
import org.junit.jupiter.api.Test;
109
import org.springframework.hateoas.MediaTypes;
11-
import org.springframework.http.HttpRequest;
1210
import org.springframework.http.HttpStatus;
13-
import org.springframework.http.client.ClientHttpRequestExecution;
14-
import org.springframework.http.client.ClientHttpRequestInterceptor;
15-
import org.springframework.http.client.ClientHttpResponse;
1611
import org.springframework.mock.http.client.MockClientHttpResponse;
1712
import org.springframework.web.client.RestClient;
1813

0 commit comments

Comments
 (0)