]> git.bitcoin.ninja Git - ldk-java/commitdiff
[C#] Run tests against release library in determinism CI run
authorMatt Corallo <git@bluematt.me>
Fri, 24 May 2024 15:32:07 +0000 (15:32 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 7 Jun 2024 02:00:36 +0000 (02:00 +0000)
.github/workflows/build.yml
c_sharp/tests.csproj [new file with mode: 0644]
genbindings.sh

index b5bfa8a7214b4134021c67aed01a3e0551777ccd..962bcbeb602d6bcfa4743d3c99f53ca49ca73d15 100644 (file)
@@ -258,6 +258,13 @@ jobs:
             diffoscope ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"org.ldk.nupkg c_sharp/org.ldk.nupkg || echo
             exit 1
           fi
+      - name: Run test against C# release library
+        shell: bash
+        run: |
+          cd c_sharp
+          ln -s ./packaging_artifacts/runtimes/linux-x64/native/libldkcsharp.so ./
+          LD_LIBRARY_PATH=. dotnet run --project tests.csproj
+          LD_LIBRARY_PATH=. dotnet run --project tests.csproj --configuration Release
 
   java_bindings:
     runs-on: ubuntu-latest
diff --git a/c_sharp/tests.csproj b/c_sharp/tests.csproj
new file mode 100644 (file)
index 0000000..85b28fb
--- /dev/null
@@ -0,0 +1,11 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <OutputType>Exe</OutputType>
+  </PropertyGroup>
+
+</Project>
index f3dd774cce752312f6d2c7998a713aa472535ab5..5e2fb0fffd5fde4b509fbe1871948dc98f9a04b4 100755 (executable)
@@ -148,7 +148,7 @@ if [ "$2" = "c_sharp" ]; then
                mono-csc -g -out:csharpldk.dll -langversion:3 -t:library -unsafe c_sharp/src/org/ldk/enums/*.cs c_sharp/src/org/ldk/impl/*.cs c_sharp/src/org/ldk/util/*.cs c_sharp/src/org/ldk/structs/*.cs
        else
                cd c_sharp
-               dotnet build --configuration Release
+               dotnet build csharpldk.csproj --configuration Release
                cd ..
        fi