Compare commits
1 Commits
ad751e6c72
...
c9c4398451
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c9c4398451 |
16
.github/workflows/ci.yaml
vendored
16
.github/workflows/ci.yaml
vendored
@ -1,11 +1,13 @@
|
||||
name: CI
|
||||
on: [ push ]
|
||||
on: [ push, pull_request ]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
env:
|
||||
REPO: ${{ github.event.repository.name }}
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
@ -14,11 +16,21 @@ jobs:
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '21'
|
||||
java-version: '17'
|
||||
|
||||
- name: Build Runner
|
||||
run: ./mvnw --no-transfer-progress clean verify -Pnative -Dquarkus.native.remote-container-build=true
|
||||
|
||||
- name: Add coverage to PR
|
||||
id: jacoco
|
||||
uses: madrapps/jacoco-report@v1.7.1
|
||||
with:
|
||||
paths: ${{ github.workspace }}/**/target/coverage/jacoco.xml
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
min-coverage-overall: 40
|
||||
min-coverage-changed-files: 60
|
||||
title: ${{ env.REPO }} Coverage
|
||||
|
||||
- name: Build Container
|
||||
run: docker build -f src/main/docker/Dockerfile.native-micro -t ${{ env.REPO }} .
|
||||
|
||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,9 +1,5 @@
|
||||
*~
|
||||
|
||||
searxng-docker.service
|
||||
caddy
|
||||
srv
|
||||
searxng/uwsgi.ini
|
||||
|
||||
.idea
|
||||
target
|
||||
pom.xml.versionsBackup
|
||||
|
55
pom.xml
55
pom.xml
@ -14,9 +14,10 @@
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
|
||||
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
|
||||
<quarkus.platform.version>3.15.1</quarkus.platform.version>
|
||||
<quarkus.platform.version>3.16.0.CR1</quarkus.platform.version>
|
||||
<skipITs>true</skipITs>
|
||||
<surefire-plugin.version>3.3.1</surefire-plugin.version>
|
||||
<surefire-plugin.version>3.5.1</surefire-plugin.version>
|
||||
<jacoco.version>0.8.12</jacoco.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
@ -74,6 +75,11 @@
|
||||
<version>${kotlin.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-jacoco</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@ -109,6 +115,11 @@
|
||||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||
<quarkus.jacoco.data-file>${maven.multiModuleProjectDirectory}/target/jacoco.exec
|
||||
</quarkus.jacoco.data-file>
|
||||
<quarkus.jacoco.reuse-data-file>true</quarkus.jacoco.reuse-data-file>
|
||||
<quarkus.jacoco.report-location>${maven.multiModuleProjectDirectory}/target/coverage
|
||||
</quarkus.jacoco.report-location>
|
||||
<maven.home>${maven.home}</maven.home>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
@ -130,9 +141,49 @@
|
||||
</native.image.path>
|
||||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||
<maven.home>${maven.home}</maven.home>
|
||||
<quarkus.test.arg-line>${argLine}</quarkus.test.arg-line>
|
||||
</systemPropertyVariables>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>${jacoco.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-prepare-agent</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<exclClassLoaders>*QuarkusClassLoader</exclClassLoaders>
|
||||
<destFile>${project.build.directory}/jacoco-quarkus.exec</destFile>
|
||||
<append>true</append>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>default-prepare-agent-integration</id>
|
||||
<goals>
|
||||
<goal>prepare-agent-integration</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<destFile>${project.build.directory}/jacoco-quarkus.exec</destFile>
|
||||
<append>true</append>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
<phase>post-integration-test</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<dataFile>${project.build.directory}/jacoco-quarkus.exec</dataFile>
|
||||
<outputDirectory>${project.build.directory}/jacoco-report</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
|
@ -0,0 +1,27 @@
|
||||
package de.arindy.mythodea.api
|
||||
|
||||
import io.quarkus.test.junit.QuarkusTest
|
||||
import io.restassured.RestAssured.given
|
||||
import org.hamcrest.Matchers.`is`
|
||||
import org.junit.jupiter.api.Test
|
||||
import java.time.Instant
|
||||
|
||||
@QuarkusTest
|
||||
class MythodeaDateResourceTest {
|
||||
|
||||
@Test
|
||||
fun testFromEndpoint() {
|
||||
given().`when`()
|
||||
.queryParams(
|
||||
"epochMillis", Instant.parse("2024-10-23T00:00:00+01:00").toEpochMilli()
|
||||
).get("/date/from/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("dayString", `is`("3. Mahntag"))
|
||||
.body("monthString", `is`("Holzmond"))
|
||||
.body("year", `is`(22))
|
||||
.body("yearNDE", `is`(23))
|
||||
.body("yearNDK", `is`(3))
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user