From: Matt Corallo Date: Thu, 6 Jun 2024 14:06:31 +0000 (+0000) Subject: [C#] Run tests against release dylib on OSX in CI X-Git-Tag: v0.0.123.1^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=1a261ab3b9770a418b1860a687e0c80a95952658;p=ldk-java [C#] Run tests against release dylib on OSX in CI --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97bf61af..e7740794 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -266,6 +266,48 @@ jobs: LD_LIBRARY_PATH=. dotnet run --project tests.csproj LD_LIBRARY_PATH=. dotnet run --project tests.csproj --configuration Release + osx_c_sharp: + strategy: + matrix: + include: + - platform: macos-13 + - platform: macos-14 + fail-fast: false + runs-on: ${{ matrix.platform }} + steps: + - name: Checkout source code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '6.0.x' + - name: Checkout latest binaries + run: | + export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)" + echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}" + # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract: + 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)" + wget -O bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}" + mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}" + cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}" + tar xvvf ../../bins-snapshot.tgz + mv ldk-java-bins-*/* ./ + unzip org.ldk.nupkg + - name: Run test against C# release library + shell: bash + run: | + export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)" + cd c_sharp + if [ "$(uname -m)" = "arm64" ]; then + cp "../ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/runtimes/osx-arm64/native/libldkcsharp.dylib" ./libldkcsharp.dylib + else + cp "../ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/runtimes/osx-x64/native/libldkcsharp.dylib" ./libldkcsharp.dylib + fi + LD_LIBRARY_PATH=. dotnet run --project tests.csproj + LD_LIBRARY_PATH=. dotnet run --project tests.csproj --configuration Release + java_bindings: runs-on: ubuntu-latest # Ubuntu's version of rustc uses its own LLVM instead of being a real native package.