Skip to content

Commit b0b9c13

Browse files
committed
feat: add unified test suite CI job
1 parent 53bf197 commit b0b9c13

File tree

15 files changed

+1625
-0
lines changed

15 files changed

+1625
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Unified Test Suite
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
unified-test-suite:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Java 17
17+
uses: actions/setup-java@v4
18+
with:
19+
distribution: 'temurin'
20+
java-version: '17'
21+
22+
- name: Set up Node.js 18
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '18'
26+
27+
- name: Build with Gradle
28+
working-directory: adapter
29+
run: |
30+
./gradlew build
31+
JAR_PATH=$(find $(pwd) -name '*standalone.jar' | head -n 1)
32+
echo "JAR_PATH=$JAR_PATH" >> $GITHUB_ENV
33+
34+
- name: Install uts-pubsub globally
35+
run: npm install -g @ably-labs/uts-pubsub
36+
37+
- name: Run uts-pubsub with ADAPTER_EXECUTABLE
38+
env:
39+
ADAPTER_EXECUTABLE: java -jar ${{ env.JAR_PATH }}
40+
run: uts-pubsub

adapter/build.gradle.kts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
val ktor_version: String by project
2+
val kotlin_version: String by project
3+
val logback_version: String by project
4+
5+
plugins {
6+
kotlin("jvm") version "1.9.22"
7+
id("io.ktor.plugin") version "2.3.7"
8+
}
9+
10+
group = "com.ably.java"
11+
version = "0.0.1"
12+
13+
application {
14+
mainClass.set("com.ably.java.ApplicationKt")
15+
}
16+
17+
tasks {
18+
val fatJar = register<Jar>("fatJar") {
19+
dependsOn.addAll(listOf("compileJava", "compileKotlin", "processResources")) // We need this for Gradle optimization to work
20+
archiveClassifier.set("standalone") // Naming the jar
21+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
22+
manifest { attributes(mapOf("Main-Class" to application.mainClass)) } // Provided we set it up in the application plugin configuration
23+
val sourcesMain = sourceSets.main.get()
24+
val contents = configurations.runtimeClasspath.get()
25+
.map { if (it.isDirectory) it else zipTree(it) } +
26+
sourcesMain.output
27+
from(contents)
28+
}
29+
build {
30+
dependsOn(fatJar)
31+
}
32+
}
33+
34+
repositories {
35+
mavenCentral()
36+
}
37+
38+
dependencies {
39+
implementation("io.ably:ably-java:1.2.38")
40+
implementation("com.benasher44:uuid:0.8.2")
41+
implementation("io.ktor:ktor-client-core")
42+
implementation("io.ktor:ktor-client-cio")
43+
implementation("io.ktor:ktor-client-logging")
44+
implementation("io.ktor:ktor-client-websockets")
45+
implementation("io.ktor:ktor-serialization-kotlinx-json")
46+
implementation("io.ktor:ktor-client-content-negotiation")
47+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
48+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1")
49+
implementation("com.google.code.gson:gson:2.9.0")
50+
implementation("ch.qos.logback:logback-classic:$logback_version")
51+
}

adapter/gradle.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ktor_version=2.3.7
2+
kotlin_version=1.9.22
3+
logback_version=1.4.11
4+
kotlin.code.style=official
58.1 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

adapter/gradlew

Lines changed: 234 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)