-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d78cab0
commit a58f4f6
Showing
6 changed files
with
175 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Continuous Integration Checks - Kotlin | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
check-kotlin: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
LDK_NODE_JVM_DIR: bindings/kotlin/ldk-node-jvm | ||
LDK_NODE_ANDROID_DIR: bindings/kotlin/ldk-node-android | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
|
||
- name: Run ktlintCheck on ldk-node-jvm | ||
run: | | ||
cd $LDK_NODE_JVM_DIR | ||
./gradlew ktlintCheck | ||
- name: Run ktlintCheck on ldk-node-android | ||
run: | | ||
cd $LDK_NODE_ANDROID_DIR | ||
./gradlew ktlintCheck | ||
- name: Generate Kotlin JVM | ||
run: ./scripts/uniffi_bindgen_generate_kotlin.sh | ||
|
||
- name: Generate Kotlin Android | ||
run: ./scripts/uniffi_bindgen_generate_kotlin_android.sh | ||
|
||
- name: Start bitcoin and electrs | ||
run: docker compose up -d | ||
|
||
- name: Run ldk-node-jvm tests | ||
run: | | ||
cd $LDK_NODE_JVM_DIR | ||
./gradlew test | ||
- name: Run ldk-node-android tests | ||
run: | | ||
cd $LDK_NODE_ANDROID_DIR | ||
./gradlew test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.* | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent.* | ||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent.SKIPPED | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_ERROR | ||
import org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_OUT | ||
|
||
// library version is defined in gradle.properties | ||
val libraryVersion: String by project | ||
|
@@ -12,6 +16,7 @@ plugins { | |
id("java-library") | ||
id("maven-publish") | ||
id("signing") | ||
id("org.jlleitschuh.gradle.ktlint") version "11.6.1" | ||
} | ||
|
||
repositories { | ||
|
@@ -31,12 +36,12 @@ dependencies { | |
// Use the JUnit 5 integration. | ||
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.1") | ||
|
||
//// This dependency is exported to consumers, that is to say found on their compile classpath. | ||
//api("org.apache.commons:commons-math3:3.6.1") | ||
// // This dependency is exported to consumers, that is to say found on their compile classpath. | ||
// api("org.apache.commons:commons-math3:3.6.1") | ||
|
||
//// This dependency is used internally, and not exposed to consumers on their own compile classpath. | ||
//implementation("com.google.guava:guava:31.1-jre") | ||
// Align versions of all Kotlin components | ||
// // This dependency is used internally, and not exposed to consumers on their own compile classpath. | ||
// implementation("com.google.guava:guava:31.1-jre") | ||
// Align versions of all Kotlin components | ||
implementation(platform("org.jetbrains.kotlin:kotlin-bom")) | ||
|
||
// Use the Kotlin JDK 8 standard library. | ||
|
@@ -49,13 +54,13 @@ tasks.named<Test>("test") { | |
// Use JUnit Platform for unit tests. | ||
useJUnitPlatform() | ||
|
||
testLogging { | ||
testLogging { | ||
events(PASSED, SKIPPED, FAILED, STANDARD_OUT, STANDARD_ERROR) | ||
exceptionFormat = FULL | ||
showExceptions = true | ||
showCauses = true | ||
showStackTraces = true | ||
showStandardStreams = true | ||
showStandardStreams = true | ||
} | ||
} | ||
|
||
|
@@ -88,8 +93,8 @@ afterEvaluate { | |
developers { | ||
developer { | ||
id.set("tnull") | ||
name.set("Elias Rohrer") | ||
email.set("[email protected]") | ||
name.set("Elias Rohrer") | ||
email.set("[email protected]") | ||
} | ||
} | ||
} | ||
|
@@ -111,3 +116,11 @@ signing { | |
// useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) | ||
sign(publishing.publications) | ||
} | ||
|
||
ktlint { | ||
filter { | ||
exclude { entry -> | ||
entry.file.toString().contains("main") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: '3' | ||
|
||
services: | ||
bitcoin: | ||
image: ruimarinho/bitcoin-core:latest | ||
platform: linux/amd64 | ||
command: | ||
[ | ||
"-printtoconsole", | ||
"-regtest=1", | ||
"-rpcallowip=0.0.0.0/0", | ||
"-rpcbind=0.0.0.0", | ||
"-rpcuser=user", | ||
"-rpcpassword=pass", | ||
] | ||
ports: | ||
- "18443:18443" # Regtest RPC port | ||
- "18444:18444" # Regtest P2P port | ||
networks: | ||
- bitcoin-electrs | ||
healthcheck: | ||
test: ["CMD", "bitcoin-cli", "-regtest", "-rpcuser=user", "-rpcpassword=pass", "getblockchaininfo"] | ||
interval: 5s | ||
timeout: 10s | ||
retries: 5 | ||
|
||
electrs: | ||
image: blockstream/esplora:electrs-latest | ||
platform: linux/amd64 | ||
depends_on: | ||
bitcoin: | ||
condition: service_healthy | ||
command: | ||
[ | ||
"/app/electrs_bitcoin/bin/electrs", | ||
"-vvvv", | ||
"--timestamp", | ||
"--jsonrpc-import", | ||
"--cookie=user:pass", | ||
"--network=regtest", | ||
"--daemon-rpc-addr=bitcoin:18443", | ||
] | ||
ports: | ||
- "3002:3002" | ||
- "3000:3000" | ||
networks: | ||
- bitcoin-electrs | ||
|
||
networks: | ||
bitcoin-electrs: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
LDK_NODE_ANDROID_DIR="bindings/kotlin/ldk-node-android" | ||
LDK_NODE_JVM_DIR="bindings/kotlin/ldk-node-jvm" | ||
|
||
# Run ktlintFormat in ldk-node-android | ||
( | ||
cd $LDK_NODE_ANDROID_DIR || exit 1 | ||
./gradlew ktlintFormat | ||
) | ||
|
||
# Run ktlintFormat in ldk-node-jvm | ||
( | ||
cd $LDK_NODE_JVM_DIR || exit 1 | ||
./gradlew ktlintFormat | ||
) |