THRIFT-5564: setup cross test in GitHub action (#2602)

* include java and kotlin into precross
diff --git a/lib/kotlin/build.gradle.kts b/lib/kotlin/build.gradle.kts
index 842c1b9..1f7711a 100644
--- a/lib/kotlin/build.gradle.kts
+++ b/lib/kotlin/build.gradle.kts
@@ -34,6 +34,12 @@
     testImplementation(kotlin("test"))
 }
 
+kotlin {
+    jvmToolchain {
+        (this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8))
+    }
+}
+
 tasks {
     ktfmt {
         kotlinLangStyle()
diff --git a/lib/kotlin/cross-test-client/build.gradle.kts b/lib/kotlin/cross-test-client/build.gradle.kts
index 92b451a..deda467 100644
--- a/lib/kotlin/cross-test-client/build.gradle.kts
+++ b/lib/kotlin/cross-test-client/build.gradle.kts
@@ -50,6 +50,12 @@
     testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
 }
 
+kotlin {
+    jvmToolchain {
+        (this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8))
+    }
+}
+
 tasks {
     application {
         applicationName = "TestClient"
diff --git a/lib/kotlin/cross-test-server/build.gradle.kts b/lib/kotlin/cross-test-server/build.gradle.kts
index 7a0c48b..508b29d 100644
--- a/lib/kotlin/cross-test-server/build.gradle.kts
+++ b/lib/kotlin/cross-test-server/build.gradle.kts
@@ -48,6 +48,12 @@
     testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
 }
 
+kotlin {
+    jvmToolchain {
+        (this as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(8))
+    }
+}
+
 tasks {
     application {
         applicationName = "TestServer"