feat: Add pipelines (SCRUM-44) #6

Merged
ptran merged 22 commits from setup/qs into main 2024-09-25 09:15:40 +00:00
9 changed files with 111 additions and 4 deletions

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 java
id("org.springframework.boot") version "3.3.4" id("org.springframework.boot") version "3.3.4"
id("io.spring.dependency-management") version "1.1.6" 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" group = "de.szut"
version = "0.0.1-SNAPSHOT" version = "0.0.1-SNAPSHOT"
tasks.test {
useJUnitPlatform()
// Activate the 'test' profile for Spring during tests
systemProperty("spring.profiles.active", "test")
}
java { java {
toolchain { 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") implementation("org.springframework.boot:spring-boot-starter-oauth2-client:3.3.4")
runtimeOnly("org.postgresql:postgresql") runtimeOnly("org.postgresql:postgresql")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0") implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0")
testImplementation("com.h2database:h2")
} }
tasks.withType<Test> { tasks.withType<Test> {

@ -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>

@ -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>

@ -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.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.TestPropertySource;
@SpringBootTest @SpringBootTest
class Lf8StarterApplicationTests { class Lf8StarterApplicationTests {