Skip to content

Commit 6430f3d

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 584ee79 commit 6430f3d

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,14 @@ 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
253261
- name: Check latest auto-generated code is in git
254262
run: |
255263
# Checkout files that get updated with version information
@@ -275,16 +283,9 @@ jobs:
275283
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
276284
if ! diff ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"org.ldk.nupkg c_sharp/org.ldk.nupkg; then
277285
dnf -y install diffoscope mono-devel
278-
diffoscope ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"org.ldk.nupkg c_sharp/org.ldk.nupkg || echo
286+
diffoscope --max-diff-input-lines 0 ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"org.ldk.nupkg c_sharp/org.ldk.nupkg || echo
279287
exit 1
280288
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
288289
289290
osx_c_sharp:
290291
strategy:
@@ -628,15 +629,18 @@ jobs:
628629
shell: bash
629630
run: |
630631
export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
632+
SOME_DIFF=0
631633
for F in liblightningjni_MacOSX-{x86_64,aarch64}{,-leaktracking}.nativelib; do
632634
if ! diff "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/$F" "src/main/resources/$F"; then
633635
apt-get -y install diffoscope
634636
# Sadly these binaries are still non-deterministic, but only due
635637
# to a few-byte tag, thus we use diffoscope to ensure there
636-
# aren't any "real" differences and move on.
638+
# aren't any "real" differences but still fail the job.
637639
diffoscope "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/$F" "src/main/resources/$F" || echo
640+
SOME_DIFF=1
638641
fi
639642
done
643+
exit $SOME_DIFF
640644
641645
android:
642646
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)