Skip to content

Commit

Permalink
Merge pull request #5 from xenit-eu/ACC-1443
Browse files Browse the repository at this point in the history
Add CI/jacoco/sonar
  • Loading branch information
thijslemmens authored Jun 14, 2024
2 parents 0978187 + 01c41c4 commit 42b21bc
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 6 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: build
on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Build and Test
run: ./gradlew check --info
- name: Sonar Analysis
run: ./gradlew jacocoTestReport sonar --info
if: env.SONAR_TOKEN != null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
16 changes: 16 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
plugins {
id 'java-library'
id 'io.freefair.lombok' version '8.6'
id 'jacoco'
id 'org.sonarqube'
}

java {
Expand All @@ -9,6 +11,20 @@ java {
}
}

jacocoTestReport {
reports {
xml.required = true
}
}

sonarqube {
properties {
property "sonar.projectKey", "xenit-eu_java-hateoas-hal-client"
property "sonar.organization", "xenit-eu"
property "sonar.host.url", "https://sonarcloud.io"
}
}

test {
useJUnitPlatform()
}
Expand Down
4 changes: 4 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true
lombok.nonnull.exceptiontype = IllegalArgumentException
lombok.anyConstructor.addConstructorProperties=true
26 changes: 26 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pluginManagement {
plugins {
id 'org.ajoberstar.grgit' version '5.2.2'
id 'org.sonarqube' version '5.0.0.4638'
}
}

plugins {
id 'org.ajoberstar.reckon.settings' version '0.18.3'
id 'eu.xenit.enterprise-conventions.oss' version '0.5.1'
}

dependencyResolutionManagement {
repositories {
mavenCentral()
}
}

reckon {
defaultInferredScope = 'patch'
snapshots()
scopeCalc = calcScopeFromCommitMessages()
stageCalc = { inventory, targetNormal -> java.util.Optional.empty() }
}

rootProject.name = 'java-hal-client'
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
@RequiredArgsConstructor(access = AccessLevel.PACKAGE)
public class HalLink {

@Getter
@NonNull
String href;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.io.IOException;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.Test;
import org.springframework.hateoas.MediaTypes;
import org.springframework.http.HttpRequest;
import org.springframework.http.HttpStatus;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.http.client.ClientHttpRequestInterceptor;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.mock.http.client.MockClientHttpResponse;
import org.springframework.web.client.RestClient;

Expand Down

0 comments on commit 42b21bc

Please sign in to comment.