1 name: Continuous Integration Checks
3 on: [push, pull_request]
8 # Ubuntu's version of clang doesn't support....anything that should work.
9 # Ubuntu is an utter trash OS and should generally never be used for anything.
10 # We also require at least rustc 1.51 (ie https://github.com/rust-lang/rust/pull/79998),
11 # so we use debian testing
12 container: debian:bookworm
16 - name: Install build utilities and test that clang can build for wasm
19 apt-get -y dist-upgrade
20 apt-get -y install cargo libstd-rust-dev-wasm32 lld git g++ clang curl node-typescript npm python3 wasi-libc
21 echo "int main() {}" > genbindings_wasm_test_file.c
22 clang -nostdlib -o /dev/null --target=wasm32-wasi -Wl,--no-entry genbindings_wasm_test_file.c
23 rm genbindings_wasm_test_file.c
24 - name: Checkout source code
25 uses: actions/checkout@v2
28 - name: Install cbindgen
30 git clone https://github.com/eqrion/cbindgen
33 cargo update -p indexmap --precise "1.6.2" --verbose
34 cargo install --locked --path .
35 - name: Checkout Rust-Lightning and LDK-C-Bindings git
37 git config --global user.email "ldk-ci@example.com"
38 git config --global user.name "LDK CI"
39 # Note this is a different endpoint, as we need one non-upstream commit!
40 git clone https://git.bitcoin.ninja/rust-lightning
42 git checkout origin/2022-06-108-java-bindings
44 git clone https://github.com/lightningdevkit/ldk-c-bindings
47 - name: Rebuild C bindings without STD
50 ./genbindings.sh ../rust-lightning false
51 - name: Build and Test TS Debug Bindings for Node
53 # We need FinalizationRegistry and top-level await support, which requires node 14.6/8,
54 # however Debian ships with Node 12
55 # Thus, we install the binary nodejs from nodejs.org and test with that.
56 curl https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz > nodejs.tar.xz
57 tar xvvf nodejs.tar.xz
58 export PATH=$(pwd)/$(echo node-*/bin):$PATH
59 ./genbindings.sh ./ldk-c-bindings/ wasm true false
60 - name: Build and Test TS Release Bindings for Node
62 export PATH=$(pwd)/$(echo node-*/bin):$PATH
63 ./genbindings.sh ./ldk-c-bindings/ wasm false false
64 - name: Install Playwright for Web Tests
66 export HOME=/root/ # Github actions is apparently broken
67 export PATH=$(pwd)/$(echo node-*/bin):$PATH
68 # npx playwright install-deps is broken so we do it manually, see https://github.com/microsoft/playwright/issues/11165
69 apt-get install -y --no-install-recommends fonts-liberation libenchant-2-2 libicu67 libjpeg62-turbo libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdbus-1-3 libdrm2 libegl1 libgbm1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxrandr2 libxshmfence1 xvfb fonts-noto-color-emoji fonts-unifont libfontconfig libfreetype6 xfonts-scalable fonts-ipafont-gothic fonts-wqy-zenhei fonts-tlwg-loma-otf ffmpeg libcairo-gobject2 libdbus-glib-1-2 libfontconfig1 libgdk-pixbuf2.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libxcb-shm0 libxcursor1 libxi6 libxrender1 libxt6 gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good libepoxy0 libevdev2 libgl1 libgles2 libgstreamer-gl1.0-0 libgstreamer1.0-0 libharfbuzz-icu0 libharfbuzz0b libhyphen0 libnotify4 libopenjp2-7 libopus0 libpng16-16 libsecret-1-0 libsoup2.4-1 libwayland-client0 libwayland-egl1 libwayland-server0 libwebp7 libwebpdemux2 libwoff1 libxkbcommon0 libxml2 libxslt1.1
70 mkdir -p $HOME/.cache/ms-playwright # `playwright install` is too dumb to create this for us
73 npx playwright install
74 - name: Build and Test TS Debug Bindings for Web
76 export HOME=/root/ # Github actions is apparently broken
77 export PATH=$(pwd)/$(echo node-*/bin):$PATH
78 ./genbindings.sh ./ldk-c-bindings/ wasm true true
80 rm liblightningjs.wasm && ln -s $(pwd)/../liblightningjs_debug.wasm ./liblightningjs.wasm
81 python3 -m http.server &
85 - name: Build and Test TS Release Bindings for Web
87 export HOME=/root/ # Github actions is apparently broken
88 export PATH=$(pwd)/$(echo node-*/bin):$PATH
89 ./genbindings.sh ./ldk-c-bindings/ wasm false true
91 rm liblightningjs.wasm && ln -s $(pwd)/../liblightningjs_release.wasm ./liblightningjs.wasm
92 python3 -m http.server &
96 - name: Check latest TS files are in git
101 runs-on: ubuntu-latest
102 # Ubuntu's version of rustc uses its own LLVM instead of being a real native package.
103 # This leaves us with an incompatible LLVM version when linking. Instead, use a real OS.
104 container: debian:bullseye
108 - name: Install native Rust toolchain, Valgrind, and build utilitis
111 apt-get -y dist-upgrade
112 apt-get -y install cargo valgrind lld git g++ clang openjdk-11-jdk maven faketime zip unzip llvm curl
113 - name: Checkout source code
114 uses: actions/checkout@v2
117 - name: Install cbindgen
119 git clone https://github.com/eqrion/cbindgen
122 cargo update -p indexmap --precise "1.6.2" --verbose
123 cargo install --locked --path .
124 - name: Checkout Rust-Lightning and LDK-C-Bindings git
126 git config --global user.email "ldk-ci@example.com"
127 git config --global user.name "LDK CI"
128 # Note this is a different endpoint, as we need one non-upstream commit!
129 git clone https://git.bitcoin.ninja/rust-lightning
131 git checkout origin/2022-06-108-java-bindings
133 git clone https://github.com/lightningdevkit/ldk-c-bindings
136 - name: Rebuild C bindings, and check the sample app builds + links
139 ./genbindings.sh ../rust-lightning true
140 - name: Build Java Debug Bindings
141 run: ./genbindings.sh ./ldk-c-bindings/ "-I/usr/lib/jvm/java-11-openjdk-amd64/include/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/" true false
142 - name: Run Java Tests against Debug Bindings
144 mv liblightningjni_debug_Linux-amd64.so liblightningjni.so
145 export ASAN_OPTIONS=detect_leaks=0
146 LD_PRELOAD=/usr/lib/llvm-11/lib/clang/11.0.1/lib/linux/libclang_rt.asan-x86_64.so LD_LIBRARY_PATH=. mvn test
147 - name: Build Java Release Bindings
149 ./genbindings.sh ./ldk-c-bindings/ "-I/usr/lib/jvm/java-11-openjdk-amd64/include/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/" false false
150 - name: Check latest headers are in git
156 runs-on: ubuntu-latest
157 # Ubuntu's version of rustc uses its own LLVM instead of being a real native package.
158 # This leaves us with an incompatible LLVM version when linking. Instead, use a real OS.
159 container: debian:bullseye
163 - name: Install native Rust toolchain, Valgrind, and build utilitis
166 apt-get -y dist-upgrade
167 apt-get -y install cargo valgrind lld git g++ clang openjdk-11-jdk maven faketime zip unzip llvm curl
168 - name: Checkout source code
169 uses: actions/checkout@v2
172 - name: Install cbindgen
174 git clone https://github.com/eqrion/cbindgen
177 cargo update -p indexmap --precise "1.6.2" --verbose
178 cargo install --locked --path .
179 - name: Checkout Rust-Lightning and LDK-C-Bindings git
181 git config --global user.email "ldk-ci@example.com"
182 git config --global user.name "LDK CI"
183 # Note this is a different endpoint, as we need one non-upstream commit!
184 git clone https://git.bitcoin.ninja/rust-lightning
186 git checkout origin/2022-06-108-java-bindings
188 git clone https://github.com/lightningdevkit/ldk-c-bindings
191 - name: Rebuild C bindings, and check the sample app builds + links
194 ./genbindings.sh ../rust-lightning true
195 - name: Checkout latest MacOS binaries
197 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
198 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
199 # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
200 SNAPSHOT_LINK="$(curl "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)"
201 curl -o bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
202 mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
203 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
204 tar xvvf ../../bins-snapshot.tgz
205 mv ldk-java-bins-*/* ./
206 rm -r ldk-java-bins-*
208 mkdir -p src/main/resources/
209 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/liblightningjni_MacOSX-"* src/main/resources/
210 rm src/main/resources/liblightningjni_MacOSX-*-leaktracking.nativelib
211 - name: Build Java Release Bindings
213 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
214 ./genbindings.sh ./ldk-c-bindings/ "-I/usr/lib/jvm/java-11-openjdk-amd64/include/ -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux/" false false
215 - name: Build deterministic release jar
216 run: ./build-release-jar.sh
217 - name: Check latest library and jars are in bins repo
219 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
220 mkdir ldk-java-bins/new/
221 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_Mac*.nativelib ldk-java-bins/new/
222 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"LDK-release.aar ldk-java-bins/new/
223 # ldk-java-leaktracking is only for debug purposes and we don't bother with determinism
224 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"ldk-java-leaktracking.jar ldk-java-bins/new/
225 cp src/main/resources/liblightningjni_Linux-amd64.nativelib ldk-java-bins/new/
226 cp ldk-java-sources.jar ldk-java-bins/new/
227 cp ldk-java.jar ldk-java-bins/new/
228 cp ldk-java-classes.jar ldk-java-bins/new/
229 cp ldk-java-javadoc.jar ldk-java-bins/new/
231 if ! diff -r "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/" new/; then
232 apt-get -y install diffoscope
233 diffoscope new/ldk-java-sources.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-sources.jar" || echo
234 diffoscope new/ldk-java-javadoc.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-javadoc.jar" || echo
235 diffoscope new/ldk-java-classes.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-classes.jar" || echo
236 diffoscope new/ldk-java.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java.jar" || echo
239 - name: Run Java Tests against built release jar
241 mvn install:install-file -Dfile=ldk-java.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
244 java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
247 runs-on: ubuntu-latest
248 # Frankly, I'm not really sure why debian and ubuntu differ in the results here, they really shouldn't
249 container: debian:bullseye
253 - name: Install rust targets
256 apt-get -y dist-upgrade
257 apt-get -y install git g++ clang faketime zip unzip curl openjdk-11-jdk
258 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
262 rustup target add armv7-linux-androideabi
263 rustup target add aarch64-linux-android
264 rustup target add i686-linux-android
265 rustup target add x86_64-linux-android
266 - name: Checkout source code
267 uses: actions/checkout@v2
270 - name: Install android NDK compilers
272 curl https://dl.google.com/android/repository/android-ndk-r22b-linux-x86_64.zip > android-ndk-r22b-linux-x86_64.zip
273 if [ "$(sha256sum android-ndk-r22b-linux-x86_64.zip | awk '{ print $1 }')" != "ac3a0421e76f71dd330d0cd55f9d99b9ac864c4c034fc67e0d671d022d4e806b" ]; then
277 unzip android-ndk-r22b-linux-x86_64.zip
278 - name: Install cbindgen
281 cargo install cbindgen
282 - name: Checkout Rust-Lightning and LDK-C-Bindings git
284 git config --global user.email "ldk-ci@example.com"
285 git config --global user.name "LDK CI"
286 # Note this is a different endpoint, as we need one non-upstream commit!
287 git clone https://git.bitcoin.ninja/rust-lightning
289 git checkout origin/2022-06-108-java-bindings
291 git clone https://github.com/lightningdevkit/ldk-c-bindings
294 - name: Checkout Android AAR binaries and artifacts
296 # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
297 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
298 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
299 RELEASE_PAGE="https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=tree;f=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE};hb=refs/heads/main"
300 SNAPSHOT_LINK="$(curl "$RELEASE_PAGE" | grep snapshot | grep -o 'href="[a-zA-Z0-9/?\.=;\-]*"' | sed 's/href="//' | tr -d '"' | grep snapshot)"
301 curl -o bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
303 ANDROID_PAGE="https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=tree;f=android-artifacts;hb=refs/heads/main"
304 SNAPSHOT_LINK="$(curl "$ANDROID_PAGE" | grep snapshot | grep -o 'href="[a-zA-Z0-9/?\.=;\-]*"' | sed 's/href="//' | tr -d '"' | grep snapshot)"
305 curl -o android-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
307 mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
308 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
309 tar xvvf ../../bins-snapshot.tgz
310 mv ldk-java-bins-*/* ./
311 rm -r ldk-java-bins-*
313 mkdir -p ../android-artifacts
314 cd ../android-artifacts
315 tar xvvf ../../android-snapshot.tgz
316 mv ldk-java-bins-*/* ./
317 rm -r ldk-java-bins-*
318 - name: Build Android aar
321 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
322 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-classes.jar" ./
323 export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64"
324 export PATH="$PATH:$ANDROID_TOOLCHAIN/bin"
325 ./android-build.sh ./rust-lightning ./ldk-c-bindings/ ./ldk-java-bins/android-artifacts
326 - name: Check latest library and jars are in bins repo
328 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
329 if ! diff LDK-release.aar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"LDK-release.aar; then
330 apt-get -y install diffoscope
331 diffoscope LDK-release.aar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/LDK-release.aar"
339 - platform: macos-10.15
342 runs-on: ${{ matrix.platform }}
344 - name: Install other Rust platforms
345 run: rustup target install aarch64-apple-darwin
346 - name: Fetch upstream LLVM/clang snapshot
348 wget -O clang+llvm-14.0.5-x86_64-apple-darwin.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.5/clang+llvm-14.0.5-x86_64-apple-darwin.tar.xz
349 if [ "$(shasum -a 256 clang+llvm-14.0.5-x86_64-apple-darwin.tar.xz | awk '{ print $1 }')" != "66cf1b8e00289a567b2f5f740f068b7682e27ccf048647b836d3624376a64705" ]; then
353 - name: Unpack upstream LLVM+clang and use it by default
355 tar xvvf clang+llvm-14.0.5-x86_64-apple-darwin.tar.xz
356 - name: Checkout source code
357 uses: actions/checkout@v2
360 - name: Install cbindgen
361 run: cargo install cbindgen
362 - name: Checkout Rust-Lightning and LDK-C-Bindings git
364 git config --global user.email "ldk-ci@example.com"
365 git config --global user.name "LDK CI"
366 # Note this is a different endpoint, as we need one non-upstream commit!
367 git clone https://git.bitcoin.ninja/rust-lightning
369 git checkout origin/2022-06-108-java-bindings
371 git clone https://github.com/lightningdevkit/ldk-c-bindings
374 - name: Rebuild C bindings with upstream clang, and check the sample app builds + links
376 export PATH=`pwd`/clang+llvm-14.0.5-x86_64-apple-darwin/bin:$PATH
378 CC=clang ./genbindings.sh ../rust-lightning true
379 - name: Fetch OpenJDK 18
381 if [ "$(uname -m)" = "arm64" ]; then
382 wget -O openjdk-18.0.1.1_macos-aarch64_bin.tar.gz https://download.java.net/java/GA/jdk18.0.1.1/65ae32619e2f40f3a9af3af1851d6e19/2/GPL/openjdk-18.0.1.1_macos-aarch64_bin.tar.gz
383 if [ "$(shasum -a 256 openjdk-18.0.1.1_macos-aarch64_bin.tar.gz | awk '{ print $1 }')" != "29773ad68063bdad7fbaeb762cd873d3f243e86de380d3ac5335cdb929371fb5" ]; then
387 tar xvvf openjdk-18.0.1.1_macos-aarch64_bin.tar.gz
389 wget -O openjdk-18.0.1.1_macos-x64_bin.tar.gz https://download.java.net/java/GA/jdk18.0.1.1/65ae32619e2f40f3a9af3af1851d6e19/2/GPL/openjdk-18.0.1.1_macos-x64_bin.tar.gz
390 if [ "$(shasum -a 256 openjdk-18.0.1.1_macos-x64_bin.tar.gz | awk '{ print $1 }')" != "f02d17ec5a387555f8489abc352d973b6c10364409b597046025938e2266d72a" ]; then
394 tar xvvf openjdk-18.0.1.1_macos-x64_bin.tar.gz
396 - name: Checkout latest Linux binaries
398 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
399 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
400 # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
401 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)"
402 wget -O bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
403 mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
404 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
405 tar xvvf ../../bins-snapshot.tgz
406 mv ldk-java-bins-*/* ./
408 mkdir -p src/main/resources/
409 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/liblightningjni_Linux-"* src/main/resources/
410 - name: Build Java Release Bindings
412 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
413 export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
414 export PATH=$JAVA_HOME/bin:$PATH
415 export PATH=`pwd`/clang+llvm-14.0.5-x86_64-apple-darwin/bin:$PATH
416 ./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
418 if [ "${{ matrix.platform }}" = "macos-11" ]; then
419 export CC="clang --target=aarch64-apple-darwin"
420 export LDK_TARGET=aarch64-apple-darwin
421 export LDK_TARGET_CPU=apple-a14
422 ./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
423 cat src/main/resources/liblightningjni_MacOSX-aarch64.nativelib > /dev/null
427 - name: Fetch Maven 3.8.4
429 # We don't bother using the upstream mirrors as they remove prior
430 # releases aggressively, causing spurious CI failures when we don't
431 # care about the version used.
432 wget -O apache-maven-3.8.4-bin.tar.gz https://bitcoin.ninja/apache-maven-3.8.4-bin.tar.gz
433 if [ "$(shasum -a 256 apache-maven-3.8.4-bin.tar.gz | awk '{ print $1 }')" != "2cdc9c519427bb20fdc25bef5a9063b790e4abd930e7b14b4e9f4863d6f9f13c" ]; then
437 tar xvvf apache-maven-3.8.4-bin.tar.gz
438 export PATH=apache-maven-3.8.4/bin:$PATH
439 - name: Run Java Tests against built jar
441 export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
442 export PATH=$JAVA_HOME/bin:$PATH
443 mvn -DskipTests=true package
444 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
445 JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
446 mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
449 java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
450 - name: Check latest release libs are in git
452 if [ "${{ matrix.platform }}" = "macos-11" ]; then
453 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
454 # Sadly, OSX binaries are not currently deterministic, more debugging is needed.
455 diff "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-x86_64.nativelib src/main/resources/liblightningjni_MacOSX-x86_64.nativelib || echo
456 diff "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-aarch64.nativelib src/main/resources/liblightningjni_MacOSX-aarch64.nativelib || echo
458 - name: Upload CI x86_64 build for analysis
459 if: matrix.platform == 'macos-11'
460 uses: actions/upload-artifact@v3.0.0
462 name: liblightningjni_MacOSX-x86_64.nativelib.ci-build
463 path: src/main/resources/liblightningjni_MacOSX-x86_64.nativelib
464 - name: Upload CI aarch64 build for analysis
465 if: matrix.platform == 'macos-11'
466 uses: actions/upload-artifact@v3.0.0
468 name: liblightningjni_MacOSX-aarch64.nativelib.ci-build
469 path: src/main/resources/liblightningjni_MacOSX-aarch64.nativelib
470 - name: Run Java Tests against release bins
472 if [ "${{ matrix.platform }}" != "macos-11" ]; then
473 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
474 export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
475 export PATH=$JAVA_HOME/bin:$PATH
476 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-{x86_64,aarch64}.nativelib src/main/resources/
478 mvn -q -B -DskipTests=true package
479 JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
480 mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
483 java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar