Skip to content

Commit 83fe303

Browse files
committed
Add ci.yml for matrix builds on Java/OS
* Add test-specific `javaLauncher` configuration based on the `testJavaVersion` project property propagated from the mentioned `ci.yml` * Upgrade `gradle.toolchains` to `1.0.0` * Upgrade `Mockito` to `1.0.0` * Fix Kotlin compile Gradle tasks to target Java `17`
1 parent fed5324 commit 83fe303

3 files changed

Lines changed: 45 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
branches:
8+
- main
9+
- '*.x'
10+
11+
concurrency:
12+
group: group-ci-for-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
ci:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
testJavaVersion: [ 17, 21, 25 ]
21+
os: [ ubuntu-latest, macos-latest, windows-latest ]
22+
23+
uses: spring-io/spring-github-workflows/.github/workflows/spring-gradle-ci.yml@main
24+
with:
25+
testJavaVersion: ${{ matrix.testJavaVersion }}
26+
runner: ${{ matrix.os }}
27+
secrets:
28+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

build.gradle

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ext {
8585
mailVersion = '2.0.5'
8686
micrometerTracingVersion = '1.5.10'
8787
micrometerVersion = '1.15.10'
88-
mockitoVersion = '5.17.0'
88+
mockitoVersion = '5.18.0'
8989
mongoDriverVersion = '5.5.2'
9090
mysqlVersion = '9.3.0'
9191
oracleVersion = '23.8.0.25.04'
@@ -245,11 +245,13 @@ configure(javaProjects) { subproject ->
245245
options.encoding = 'UTF-8'
246246
}
247247

248-
compileKotlin {
249-
compilerOptions {
250-
allWarningsAsErrors = true
251-
}
252-
}
248+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask).configureEach {
249+
compilerOptions {
250+
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
251+
javaParameters = true
252+
allWarningsAsErrors = true
253+
}
254+
}
253255

254256
tasks.withType(JavaCompile).configureEach {
255257
options.fork = true
@@ -344,7 +346,14 @@ configure(javaProjects) { subproject ->
344346
reports.junitXml.required = false
345347

346348
enableAssertions = false
347-
}
349+
350+
javaLauncher = javaToolchains.launcherFor {
351+
languageVersion = JavaLanguageVersion.of(project.findProperty('testJavaVersion') ?: 17)
352+
}
353+
354+
jvmArgs '-Xshare:off',
355+
'--enable-native-access=ALL-UNNAMED'
356+
}
348357

349358
checkstyle {
350359
configDirectory.set(rootProject.file('src/checkstyle'))

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pluginManagement {
77

88
plugins {
99
id 'io.spring.develocity.conventions' version '0.0.25'
10-
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.9.0'
10+
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
1111
}
1212

1313
rootProject.name = 'spring-integration'

0 commit comments

Comments
 (0)