Skip to content

Commit 4a66f35

Browse files
authored
ci: run on windows (#126)
1 parent 8f8967f commit 4a66f35

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ on:
77

88
jobs:
99
build:
10-
timeout-minutes: 5
11-
runs-on: ubuntu-latest
10+
timeout-minutes: 10
1211
strategy:
1312
fail-fast: false
1413
matrix:
1514
java: [ '17', '21', '25' ]
15+
platform: [ 'ubuntu-latest' ]
16+
include:
17+
- java: '25'
18+
platform: 'windows-latest'
19+
20+
runs-on: ${{ matrix.platform }}
1621
permissions:
1722
contents: read
1823
packages: write

coap-mbedtls/build.gradle.kts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,23 @@ dependencies {
1717
testImplementation("ch.qos.logback:logback-classic:1.5.18")
1818
testImplementation("org.awaitility:awaitility:4.3.0")
1919
}
20+
21+
22+
tasks {
23+
24+
register<Copy>("extractNativeLibs") {
25+
from(configurations.runtimeClasspath.get().filter { it.name.contains("mbedtls-lib") }.map { zipTree(it) })
26+
include("win32-x86-64/**")
27+
into(layout.buildDirectory.dir("native-libs"))
28+
}
29+
30+
31+
test {
32+
if (System.getProperty("os.name").lowercase().contains("windows")) {
33+
// On Windows, JNA cannot automatically load native libraries from JAR when they have dependencies on each other,
34+
// so we extract them and set the path explicitly.
35+
dependsOn("extractNativeLibs")
36+
systemProperty("jna.library.path", layout.buildDirectory.dir("native-libs/win32-x86-64").get().asFile.absolutePath)
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)