PMT-3: Add CI with Linting
Some checks failed
Quality Check / Linting Check (push) Failing after 42s

This commit is contained in:
Dominik Säume 2024-09-13 00:23:47 +02:00
parent 47ddf4158a
commit da876e7823
Signed by: SZUT-Dominik
GPG key ID: 67D15BB250B41E7C
5 changed files with 54 additions and 3 deletions

21
.gitea/workflows/qs.yml Normal file
View file

@ -0,0 +1,21 @@
name: "Quality Check"
on:
- push
- pull_request
jobs:
linting:
name: "Linting Check"
runs-on: "ubuntu-latest"
container:
image: "git.euph.dev/actions/runner-java-21:latest"
steps:
- name: "Checkout"
uses: "https://git.euph.dev/actions/checkout@v3"
- name: "Prepare Gradle"
run: gradle clean
- name: "Checkstyle Linting Main"
run: gradle checkstyleMain
- name: "Checkstyle Linting Test"
run: gradle checkstyleTest

View file

@ -6,11 +6,17 @@ repositories {
plugins {
java
checkstyle
id("org.springframework.boot") version "3.3.3"
id("io.spring.dependency-management") version "1.1.6"
id("org.hidetake.swagger.generator") version "2.19.2"
}
checkstyle {
toolVersion = "10.12.4"
configFile = file("src/main/resources/checkstyle.xml")
}
group = "de.hmmh"
version = "0.0.1-SNAPSHOT"
@ -73,9 +79,14 @@ tasks {
named("compileJava").configure {
dependsOn(swaggerSources.getByName("pmt").code)
}
withType<Checkstyle> {
reports {
xml.required.set(true)
html.required.set(false)
}
}
}
sourceSets {
main {
java.srcDir("${swaggerSources.getByName("pmt").code.outputDir}/src/main/java")

View file

@ -0,0 +1,19 @@
<?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">
<property name="severity" value="error"/>
<property name="tabWidth" value="4"/>
<module name="LineLength">
<property name="max" value="120"/>
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="NewlineAtEndOfFile"/>
</module>

View file

@ -23,4 +23,4 @@ public abstract class IntegrationTest {
void setUp() {
//repository.deleteAll();
}
}
}

View file

@ -25,4 +25,4 @@ public class PostgresContextInitializer implements ApplicationContextInitializer
"spring.datasource.password=" + postgres.getPassword()
).applyTo(configurableApplicationContext.getEnvironment());
}
}
}