diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index ea4906b2..35727bb2 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -65,7 +65,7 @@ jobs: - name: Install Java uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'temurin' - name: Validate Gradle wrapper diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 746747d0..89a64380 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -19,7 +19,7 @@ jobs: - name: Install Java uses: actions/setup-java@v4 with: - java-version: '17' + java-version: '21' distribution: 'temurin' - name: Validate Gradle wrapper diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index be754ef1..00000000 --- a/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM ghcr.io/graalvm/native-image:ol9-java17-22.3.3 AS builder - -# Install tar and gzip to extract the Maven binaries -RUN microdnf install --nodocs -y \ - findutils \ - && microdnf clean all \ - && rm -rf /var/cache/yum - -WORKDIR /build - -# Copy the source code into the image for building -COPY . /build - -# Build -RUN ./gradlew nativeCompile - -# The deployment Image -FROM docker.io/oraclelinux:9-slim - -EXPOSE 8080 -EXPOSE 8081 - -WORKDIR /workspace - -# Copy the native executable into the container -COPY --from=builder /build/build/native/nativeCompile . -ENTRYPOINT ["/workspace/morp"] \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 8eb66f7a..3c4507d1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -63,7 +63,7 @@ dependencies { } java { - sourceCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 } sonarqube { @@ -115,7 +115,7 @@ testing { targets { all { testTask.configure { - mustRunAfter(tasks.named("dockerBuild")) + mustRunAfter(tasks.bootBuildImage) testLogging.exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL testLogging.showStandardStreams = true } @@ -125,17 +125,6 @@ testing { } } -tasks.create("dockerBuild") { - mustRunAfter(tasks.test) - executable("docker") - args(listOf("build", "-t", "${registry}/${project.name}:${project.version}", "-t", "${registry}/${project.name}:latest", ".")) -} - -tasks.create("dockerBuildPush") { - executable("docker") - args(listOf("buildx", "build", "--platform", "linux/amd64,linux/arm64", "-t", "${registry}/${project.name}:${project.version}", "--push", ".")) -} - tasks.withType { mustRunAfter(tasks.test) imageName.value("${registry}/${project.name}:${project.version}") @@ -157,7 +146,7 @@ tasks.withType { tasks.check { dependsOn(tasks.test) - dependsOn(tasks.named("dockerBuild")) + dependsOn(tasks.bootBuildImage) dependsOn(testing.suites.named("integrationTest")) dependsOn(tasks.jacocoTestReport) } diff --git a/src/test/java/io/jaconi/morp/MorpApplicationTests.java b/src/test/java/io/jaconi/morp/MorpApplicationTests.java index 073cd5ab..c4156088 100644 --- a/src/test/java/io/jaconi/morp/MorpApplicationTests.java +++ b/src/test/java/io/jaconi/morp/MorpApplicationTests.java @@ -14,7 +14,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -@SpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @DisabledInAotMode class MorpApplicationTests { diff --git a/src/test/java/io/jaconi/morp/oauth/MorpReactiveOAuth2UserServiceTest.java b/src/test/java/io/jaconi/morp/oauth/MorpReactiveOAuth2UserServiceTest.java index 2682915d..e5b45cec 100644 --- a/src/test/java/io/jaconi/morp/oauth/MorpReactiveOAuth2UserServiceTest.java +++ b/src/test/java/io/jaconi/morp/oauth/MorpReactiveOAuth2UserServiceTest.java @@ -31,7 +31,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@SpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @DisabledInAotMode class MorpReactiveOAuth2UserServiceTest { diff --git a/src/test/java/io/jaconi/morp/oauth/MorpReactiveOidcUserServiceTest.java b/src/test/java/io/jaconi/morp/oauth/MorpReactiveOidcUserServiceTest.java index b9eff4fe..ffc38d32 100644 --- a/src/test/java/io/jaconi/morp/oauth/MorpReactiveOidcUserServiceTest.java +++ b/src/test/java/io/jaconi/morp/oauth/MorpReactiveOidcUserServiceTest.java @@ -27,7 +27,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -@SpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @DisabledInAotMode class MorpReactiveOidcUserServiceTest { diff --git a/src/test/java/io/jaconi/morp/oauth/RegistrationResolverTest.java b/src/test/java/io/jaconi/morp/oauth/RegistrationResolverTest.java index 2fd6ffae..cf245a34 100644 --- a/src/test/java/io/jaconi/morp/oauth/RegistrationResolverTest.java +++ b/src/test/java/io/jaconi/morp/oauth/RegistrationResolverTest.java @@ -16,7 +16,7 @@ import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.when; -@SpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @DisabledInAotMode class RegistrationResolverTest { diff --git a/src/test/java/io/jaconi/morp/oauth/TenantAwareClientRegistrationRepositoryTest.java b/src/test/java/io/jaconi/morp/oauth/TenantAwareClientRegistrationRepositoryTest.java index 80e98ab5..9a4889df 100644 --- a/src/test/java/io/jaconi/morp/oauth/TenantAwareClientRegistrationRepositoryTest.java +++ b/src/test/java/io/jaconi/morp/oauth/TenantAwareClientRegistrationRepositoryTest.java @@ -17,7 +17,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; -@SpringBootTest +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @DisabledInAotMode class TenantAwareClientRegistrationRepositoryTest {