Skip to content

Commit 1d3ea75

Browse files
committed
Make CI behavior for diffs more consistent
While some of our determinism checks fail for trivial cases (specifically for macOS and Windows builds), we still want CI jobs to fail to ensure they get manual verification.
1 parent 0c281cc commit 1d3ea75

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,15 @@ jobs:
250250
with:
251251
name: org.ldk.nupkg
252252
path: c_sharp/org.ldk.nupkg
253+
- name: Run test against C# release library
254+
shell: bash
255+
run: |
256+
cd c_sharp
257+
sed 's/net.\.0/net9.0/' -i tests.csproj
258+
ln -s ./packaging_artifacts/runtimes/linux-x64/native/libldkcsharp.so ./
259+
LD_LIBRARY_PATH=. dotnet run --project tests.csproj
260+
LD_LIBRARY_PATH=. dotnet run --project tests.csproj --configuration Release
261+
git checkout tests.csproj
253262
- name: Check latest auto-generated code is in git
254263
run: |
255264
# Checkout files that get updated with version information
@@ -275,16 +284,9 @@ jobs:
275284
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
276285
if ! diff ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"org.ldk.nupkg c_sharp/org.ldk.nupkg; then
277286
dnf -y install diffoscope mono-devel
278-
diffoscope ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"org.ldk.nupkg c_sharp/org.ldk.nupkg || echo
287+
diffoscope --max-diff-input-lines 0 ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"org.ldk.nupkg c_sharp/org.ldk.nupkg || echo
279288
exit 1
280289
fi
281-
- name: Run test against C# release library
282-
shell: bash
283-
run: |
284-
cd c_sharp
285-
ln -s ./packaging_artifacts/runtimes/linux-x64/native/libldkcsharp.so ./
286-
LD_LIBRARY_PATH=. dotnet run --project tests.csproj
287-
LD_LIBRARY_PATH=. dotnet run --project tests.csproj --configuration Release
288290
289291
osx_c_sharp:
290292
strategy:
@@ -628,15 +630,18 @@ jobs:
628630
shell: bash
629631
run: |
630632
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
633+
SOME_DIFF=0
631634
for F in liblightningjni_MacOSX-{x86_64,aarch64}{,-leaktracking}.nativelib; do
632635
if ! diff "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/$F" "src/main/resources/$F"; then
633636
apt-get -y install diffoscope
634637
# Sadly these binaries are still non-deterministic, but only due
635638
# to a few-byte tag, thus we use diffoscope to ensure there
636-
# aren't any "real" differences and move on.
639+
# aren't any "real" differences but still fail the job.
637640
diffoscope "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/$F" "src/main/resources/$F" || echo
641+
SOME_DIFF=1
638642
fi
639643
done
644+
exit $SOME_DIFF
640645
641646
android:
642647
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)