@@ -258,6 +258,55 @@ jobs:
258258 diffoscope ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"org.ldk.nupkg c_sharp/org.ldk.nupkg || echo
259259 exit 1
260260 fi
261+ - name : Run test against C# release library
262+ shell : bash
263+ run : |
264+ cd c_sharp
265+ ln -s ./packaging_artifacts/runtimes/linux-x64/native/libldkcsharp.so ./
266+ LD_LIBRARY_PATH=. dotnet run --project tests.csproj
267+ LD_LIBRARY_PATH=. dotnet run --project tests.csproj --configuration Release
268+
269+ osx_c_sharp :
270+ strategy :
271+ matrix :
272+ include :
273+ - platform : macos-13
274+ - platform : macos-14
275+ fail-fast : false
276+ runs-on : ${{ matrix.platform }}
277+ steps :
278+ - name : Checkout source code
279+ uses : actions/checkout@v2
280+ with :
281+ fetch-depth : 0
282+ - name : Setup .NET
283+ uses : actions/setup-dotnet@v4
284+ with :
285+ dotnet-version : ' 6.0.x'
286+ - name : Checkout latest binaries
287+ run : |
288+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
289+ echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
290+ # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
291+ SNAPSHOT_LINK="$(wget -O /dev/stdout "https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=tree;f=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE};hb=refs/heads/main" | grep snapshot | grep -o 'href="[a-zA-Z0-9/?\.=;\-]*"' | sed 's/href="//' | tr -d '"' | grep snapshot)"
292+ wget -O bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
293+ mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
294+ cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
295+ tar xvvf ../../bins-snapshot.tgz
296+ mv ldk-java-bins-*/* ./
297+ unzip org.ldk.nupkg
298+ - name : Run test against C# release library
299+ shell : bash
300+ run : |
301+ export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
302+ cd c_sharp
303+ if [ "$(uname -m)" = "arm64" ]; then
304+ cp "../ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/runtimes/osx-arm64/native/libldkcsharp.dylib" ./libldkcsharp.dylib
305+ else
306+ cp "../ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/runtimes/osx-x64/native/libldkcsharp.dylib" ./libldkcsharp.dylib
307+ fi
308+ LD_LIBRARY_PATH=. dotnet run --project tests.csproj
309+ LD_LIBRARY_PATH=. dotnet run --project tests.csproj --configuration Release
261310
262311 java_bindings :
263312 runs-on : ubuntu-latest
@@ -673,44 +722,19 @@ jobs:
673722 exit 1
674723 fi
675724
676- osx :
725+ osx_java :
677726 strategy :
678727 matrix :
679728 include :
680- - platform : macos-11
681- - platform : macos-12
682729 - platform : macos-13
730+ - platform : macos-14
683731 fail-fast : false
684732 runs-on : ${{ matrix.platform }}
685733 steps :
686- - name : Install Rust components
687- run : |
688- rustup target install aarch64-apple-darwin
689- rustup component add rust-src
690734 - name : Checkout source code
691735 uses : actions/checkout@v2
692736 with :
693737 fetch-depth : 0
694- - name : Install cbindgen
695- run : cargo install cbindgen
696- - name : Checkout Rust-Lightning and LDK-C-Bindings git
697- run : |
698- git config --global user.email "ldk-ci@example.com"
699- git config --global user.name "LDK CI"
700- # Note this is a different endpoint, as we need one non-upstream commit!
701- git clone https://github.com/lightningdevkit/rust-lightning
702- cd rust-lightning
703- git checkout origin/0.0.123-bindings
704- cd ..
705- git clone https://github.com/lightningdevkit/ldk-c-bindings
706- cd ldk-c-bindings
707- git checkout 0.0.123
708- cd lightning-c-bindings
709- cargo update -p memchr --precise "2.5.0" --verbose
710- - name : Rebuild C bindings and check the sample app builds + links
711- run : |
712- cd ldk-c-bindings
713- CC=clang ./genbindings.sh ../rust-lightning true
714738 - name : Fetch OpenJDK 18
715739 run : |
716740 if [ "$(uname -m)" = "arm64" ]; then
@@ -728,7 +752,7 @@ jobs:
728752 fi
729753 tar xvvf openjdk-18.0.1.1_macos-x64_bin.tar.gz
730754 fi
731- - name : Checkout latest Linux binaries
755+ - name : Checkout latest binaries
732756 run : |
733757 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
734758 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
@@ -739,24 +763,6 @@ jobs:
739763 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
740764 tar xvvf ../../bins-snapshot.tgz
741765 mv ldk-java-bins-*/* ./
742- cd ../..
743- mkdir -p src/main/resources/
744- cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/liblightningjni_Linux-"* src/main/resources/
745- - name : Build Java Release Bindings
746- run : |
747- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
748- export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
749- export PATH=$JAVA_HOME/bin:$PATH
750- ./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
751-
752- if [ "${{ matrix.platform }}" = "macos-11" ]; then
753- export CC="clang --target=aarch64-apple-darwin"
754- export LDK_TARGET=aarch64-apple-darwin
755- export LDK_TARGET_CPU=apple-a14
756- ./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
757- cat src/main/resources/liblightningjni_MacOSX-aarch64.nativelib > /dev/null
758-
759- fi
760766 - name : Fetch Maven 3.8.4
761767 run : |
762768 # We don't bother using the upstream mirrors as they remove prior
@@ -769,17 +775,6 @@ jobs:
769775 fi
770776 tar xvvf apache-maven-3.8.4-bin.tar.gz
771777 export PATH=apache-maven-3.8.4/bin:$PATH
772- - name : Run Java Tests against built jar
773- run : |
774- export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
775- export PATH=$JAVA_HOME/bin:$PATH
776- mvn -DskipTests=true package
777- export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
778- JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
779- mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
780- cd javatester
781- mvn -q -B package
782- java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
783778 - name : Run Java Tests against release bins
784779 run : |
785780 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
0 commit comments