SCRUM-44 #closenot Co-authored-by: Phan Huy Tran <ptran@noreply.localhost> Reviewed-on: #6 Co-authored-by: Jan Klattenhoff <jan@kjan.de> Co-committed-by: Jan Klattenhoff <jan@kjan.de>
This commit is contained in:
parent
6009cc2093
commit
77f2b73085
50
.gitea/workflows/qs.yml
Normal file
50
.gitea/workflows/qs.yml
Normal file
@ -0,0 +1,50 @@
|
||||
name: "Quality Check"
|
||||
|
||||
on:
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Tests"
|
||||
runs-on: "ubuntu-latest"
|
||||
container:
|
||||
image: "cimg/openjdk:21.0-node"
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: actions/checkout@v3
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: "Prepare Gradle"
|
||||
run: gradle clean
|
||||
- name: "Check"
|
||||
run: gradle testClasses
|
||||
- name: "Stop Gradle"
|
||||
run: gradle --stop
|
||||
checkstyle:
|
||||
name: "Checkstyle Main"
|
||||
runs-on: "ubuntu-latest"
|
||||
container:
|
||||
image: "cimg/openjdk:21.0-node"
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: actions/checkout@v3
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: "Prepare Gradle"
|
||||
run: gradle clean
|
||||
- name: "Check"
|
||||
run: gradle check
|
||||
- name: "Stop Gradle"
|
||||
run: gradle --stop
|
@ -2,14 +2,32 @@ plugins {
|
||||
java
|
||||
id("org.springframework.boot") version "3.3.4"
|
||||
id("io.spring.dependency-management") version "1.1.6"
|
||||
id("checkstyle")
|
||||
}
|
||||
|
||||
tasks.withType<Checkstyle> {
|
||||
reports {
|
||||
// Disable HTML report
|
||||
html.required.set(false)
|
||||
|
||||
// Disable XML report
|
||||
xml.required.set(false)
|
||||
}
|
||||
}
|
||||
|
||||
group = "de.szut"
|
||||
version = "0.0.1-SNAPSHOT"
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
|
||||
// Activate the 'test' profile for Spring during tests
|
||||
systemProperty("spring.profiles.active", "test")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(22)
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,6 +53,7 @@ dependencies {
|
||||
implementation("org.springframework.boot:spring-boot-starter-oauth2-client:3.3.4")
|
||||
runtimeOnly("org.postgresql:postgresql")
|
||||
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")
|
||||
testImplementation("com.h2database:h2")
|
||||
}
|
||||
|
||||
tasks.withType<Test> {
|
||||
|
9
config/checkstyle/checkstyle-ignore.xml
Normal file
9
config/checkstyle/checkstyle-ignore.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Puppy Crawl//DTD Suppressions 1.2//EN"
|
||||
"https://checkstyle.org/dtds/suppressions_1_2.dtd"
|
||||
>
|
||||
|
||||
<suppressions>
|
||||
<suppress files="[\\/]de[\\/]hmmh[\\/]pmt[\\/]oas" checks="."/>
|
||||
</suppressions>
|
23
config/checkstyle/checkstyle.xml
Normal file
23
config/checkstyle/checkstyle.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd"
|
||||
>
|
||||
<module name="Checker">
|
||||
<module name="SuppressionFilter">
|
||||
<property name="file" value="${config_loc}/checkstyle-ignore.xml"/>
|
||||
</module>
|
||||
|
||||
<property name="severity" value="error"/>
|
||||
<property name="tabWidth" value="4"/>
|
||||
|
||||
<module name="LineLength">
|
||||
<property name="max" value="500"/>
|
||||
</module>
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="NewlineAtEndOfFile"/>
|
||||
|
||||
</module>
|
5
src/main/resources/application-test.properties
Normal file
5
src/main/resources/application-test.properties
Normal file
@ -0,0 +1,5 @@
|
||||
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
|
||||
spring.datasource.driver-class-name=org.h2.Driver
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=
|
||||
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
|
@ -2,6 +2,7 @@ package de.szut.lf8_starter;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
|
||||
@SpringBootTest
|
||||
class Lf8StarterApplicationTests {
|
||||
|
Loading…
Reference in New Issue
Block a user