Skip to content

Commit 23e0cfd

Browse files
committed
[C#] Run tests against release dylib on OSX in CI
1 parent 4a37256 commit 23e0cfd

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/build.yml

+32
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,38 @@ jobs:
266266
LD_LIBRARY_PATH=. dotnet run --project tests.csproj
267267
LD_LIBRARY_PATH=. dotnet run --project tests.csproj --configuration Release
268268
269+
osx_c_sharp:
270+
runs-on: macos-latest
271+
steps:
272+
- name: Checkout source code
273+
uses: actions/checkout@v2
274+
with:
275+
fetch-depth: 0
276+
- name: Setup .NET
277+
uses: actions/setup-dotnet@v4
278+
with:
279+
dotnet-version: '6.0.x'
280+
- name: Checkout latest Linux binaries
281+
run: |
282+
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
283+
echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
284+
# Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
285+
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)"
286+
wget -O bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
287+
mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
288+
cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
289+
tar xvvf ../../bins-snapshot.tgz
290+
mv ldk-java-bins-*/* ./
291+
unzip org.ldk.nupkg
292+
- name: Run test against C# release library
293+
shell: bash
294+
run: |
295+
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
296+
cd c_sharp
297+
ln -s "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/runtimes/osx-arm64/native/libldkcsharp.dylib" ./ldkcsharp.dylib
298+
LD_LIBRARY_PATH=. dotnet run --project tests.csproj
299+
LD_LIBRARY_PATH=. dotnet run --project tests.csproj --configuration Release
300+
269301
java_bindings:
270302
runs-on: ubuntu-latest
271303
# Ubuntu's version of rustc uses its own LLVM instead of being a real native package.

0 commit comments

Comments
 (0)