Skip to content

Commit 1a261ab

Browse files
committed
[C#] Run tests against release dylib on OSX in CI
1 parent 73b78bd commit 1a261ab

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,48 @@ 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+
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
310+
269311
java_bindings:
270312
runs-on: ubuntu-latest
271313
# Ubuntu's version of rustc uses its own LLVM instead of being a real native package.

0 commit comments

Comments
 (0)