Skip to content

Commit afcfa24

Browse files
committed
Add a Java 8 test on CI
1 parent 665e377 commit afcfa24

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,19 @@ jobs:
4646
# Build
4747
- name: Build with Gradle
4848
run: ./gradlew build
49+
50+
testOn8:
51+
runs-on: ubuntu-latest
52+
53+
name: Test on Java 8
54+
55+
steps:
56+
- uses: actions/checkout@v5
57+
- name: Set up JDK
58+
uses: actions/setup-java@v5
59+
with:
60+
java-version: '21'
61+
distribution: 'temurin'
62+
# Run tests with Java 8
63+
- name: Test with Java 8
64+
run: ./gradlew testOn8

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,17 @@ tasks.register('checkLegacyJava') {
132132

133133
classes.finalizedBy checkLegacyJava
134134

135+
tasks.register('testOn8', Test) {
136+
description = 'Runs tests on Java 8'
137+
dependsOn classes
138+
testClassesDirs = testing.suites.test.sources.output.classesDirs
139+
classpath = testing.suites.test.sources.runtimeClasspath
140+
useJUnitPlatform()
141+
javaLauncher = javaToolchains.launcherFor {
142+
languageVersion = JavaLanguageVersion.of(8)
143+
}
144+
}
145+
135146
tasks.register('lineEndingConversion', CRLFConvert) {
136147
description = 'Convert top-level files to Windows line endings'
137148
file "$rootDir/RELEASE_NOTES.md"

0 commit comments

Comments
 (0)