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 safe.directory '*'
38 git config --global user.email "ldk-ci@example.com"
39 git config --global user.name "LDK CI"
40 # Note this is a different endpoint, as we need one non-upstream commit!
41 git clone https://git.bitcoin.ninja/rust-lightning
43 git checkout origin/2023-02-0.0.114-java-bindings
45 git clone https://github.com/lightningdevkit/ldk-c-bindings
48 - name: Rebuild C bindings without STD
51 git config --global safe.directory "*"
52 ./genbindings.sh ../rust-lightning false
53 - name: Build and Test TS Debug Bindings for Node
55 # We need FinalizationRegistry and top-level await support, which requires node 14.6/8,
56 # however Debian ships with Node 12
57 # Thus, we install the binary nodejs from nodejs.org and test with that.
58 curl https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz > nodejs.tar.xz
59 tar xvvf nodejs.tar.xz
60 export PATH=$(pwd)/$(echo node-*/bin):$PATH
61 ./genbindings.sh ./ldk-c-bindings/ wasm true false
62 - name: Build and Test TS Release Bindings for Node
64 export PATH=$(pwd)/$(echo node-*/bin):$PATH
65 ./genbindings.sh ./ldk-c-bindings/ wasm false false
66 - name: Install Playwright for Web Tests
68 export HOME=/root/ # Github actions is apparently broken
69 export PATH=$(pwd)/$(echo node-*/bin):$PATH
70 # npx playwright install-deps is broken so we do it manually, see https://github.com/microsoft/playwright/issues/11165
71 apt-get install -y --no-install-recommends fonts-liberation libenchant-2-2 libicu72 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
72 mkdir -p $HOME/.cache/ms-playwright # `playwright install` is too dumb to create this for us
75 npx playwright install
76 - name: Build and Test TS Debug Bindings for Web
78 export HOME=/root/ # Github actions is apparently broken
79 export PATH=$(pwd)/$(echo node-*/bin):$PATH
80 git config --global safe.directory "*"
81 ./genbindings.sh ./ldk-c-bindings/ wasm true true
83 rm liblightningjs.wasm && ln -s $(pwd)/../liblightningjs_debug.wasm ./liblightningjs.wasm
84 python3 -m http.server &
88 - name: Build and Test TS Release Bindings for Web
90 export HOME=/root/ # Github actions is apparently broken
91 export PATH=$(pwd)/$(echo node-*/bin):$PATH
92 ./genbindings.sh ./ldk-c-bindings/ wasm false true
94 rm liblightningjs.wasm && ln -s $(pwd)/../liblightningjs_release.wasm ./liblightningjs.wasm
95 python3 -m http.server &
99 - name: Check latest TS files are in git
101 git checkout ts/package.json
102 git checkout node-net/package.json
106 runs-on: ubuntu-latest
107 # Ubuntu's version of rustc uses its own LLVM instead of being a real native package.
108 # This leaves us with an incompatible LLVM version when linking. Instead, use a real OS.
109 container: debian:bullseye
113 - name: Install native Rust toolchain, Valgrind, and build utilitis
116 apt-get -y dist-upgrade
117 apt-get -y install cargo valgrind lld git g++ clang openjdk-11-jdk maven faketime zip unzip llvm curl
118 - name: Checkout source code
119 uses: actions/checkout@v2
122 - name: Install cbindgen
124 git config --global safe.directory '*'
125 git clone https://github.com/eqrion/cbindgen
128 cargo update -p indexmap --precise "1.6.2" --verbose
129 cargo install --locked --path .
130 - name: Checkout Rust-Lightning and LDK-C-Bindings git
132 git config --global user.email "ldk-ci@example.com"
133 git config --global user.name "LDK CI"
134 # Note this is a different endpoint, as we need one non-upstream commit!
135 git clone https://git.bitcoin.ninja/rust-lightning
137 git checkout origin/2023-02-0.0.114-java-bindings
139 git clone https://github.com/lightningdevkit/ldk-c-bindings
142 - name: Rebuild C bindings, and check the sample app builds + links
145 ./genbindings.sh ../rust-lightning true
146 - name: Build Java Debug Bindings
147 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
148 - name: Run Java Tests against Debug Bindings
150 mv liblightningjni_debug_Linux-amd64.so liblightningjni.so
151 export ASAN_OPTIONS=detect_leaks=0
152 LD_PRELOAD=/usr/lib/llvm-11/lib/clang/11.0.1/lib/linux/libclang_rt.asan-x86_64.so LD_LIBRARY_PATH=. mvn test
153 - name: Build Java Release Bindings
155 ./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
156 - name: Check latest headers are in git
162 runs-on: ubuntu-latest
163 # Ubuntu's version of rustc uses its own LLVM instead of being a real native package.
164 # This leaves us with an incompatible LLVM version when linking. Instead, use a real OS.
165 container: debian:bullseye
169 - name: Install native Rust toolchain, Valgrind, and build utilitis
172 apt-get -y dist-upgrade
173 apt-get -y install cargo valgrind lld git g++ clang openjdk-11-jdk maven faketime zip unzip llvm curl
174 - name: Checkout source code
175 uses: actions/checkout@v2
178 - name: Install cbindgen
180 git config --global safe.directory '*'
181 git clone https://github.com/eqrion/cbindgen
184 cargo update -p indexmap --precise "1.6.2" --verbose
185 cargo install --locked --path .
186 - name: Checkout Rust-Lightning and LDK-C-Bindings git
188 git config --global user.email "ldk-ci@example.com"
189 git config --global user.name "LDK CI"
190 # Note this is a different endpoint, as we need one non-upstream commit!
191 git clone https://git.bitcoin.ninja/rust-lightning
193 git checkout origin/2023-02-0.0.114-java-bindings
195 git clone https://github.com/lightningdevkit/ldk-c-bindings
198 - name: Rebuild C bindings, and check the sample app builds + links
201 ./genbindings.sh ../rust-lightning true
202 - name: Checkout latest MacOS binaries
204 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
205 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
206 # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
207 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)"
208 curl -o bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
209 mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
210 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
211 tar xvvf ../../bins-snapshot.tgz
212 mv ldk-java-bins-*/* ./
213 rm -r ldk-java-bins-*
215 mkdir -p src/main/resources/
216 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/liblightningjni_MacOSX-"* src/main/resources/
217 rm src/main/resources/liblightningjni_MacOSX-*-leaktracking.nativelib
218 - name: Build Java Release Bindings
220 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
221 ./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
222 - name: Build deterministic release jar
223 run: ./build-release-jar.sh
224 - name: Check latest library and jars are in bins repo
226 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
227 mkdir ldk-java-bins/new/
228 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_Mac*.nativelib ldk-java-bins/new/
229 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"LDK-release.aar ldk-java-bins/new/
230 # ldk-java-leaktracking is only for debug purposes and we don't bother with determinism
231 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"ldk-java-leaktracking.jar ldk-java-bins/new/
232 cp src/main/resources/liblightningjni_Linux-amd64.nativelib ldk-java-bins/new/
233 cp ldk-java-sources.jar ldk-java-bins/new/
234 cp ldk-java.jar ldk-java-bins/new/
235 cp ldk-java-classes.jar ldk-java-bins/new/
236 cp ldk-java-javadoc.jar ldk-java-bins/new/
238 if ! diff -r "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/" new/; then
239 apt-get -y install diffoscope
240 diffoscope new/ldk-java-sources.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-sources.jar" || echo
241 diffoscope new/ldk-java-javadoc.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-javadoc.jar" || echo
242 diffoscope new/ldk-java-classes.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-classes.jar" || echo
243 diffoscope new/ldk-java.jar "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java.jar" || echo
246 - name: Run Java Tests against built release jar
248 mvn install:install-file -Dfile=ldk-java.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
251 java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
254 runs-on: ubuntu-latest
255 # Frankly, I'm not really sure why debian and ubuntu differ in the results here, they really shouldn't
256 container: debian:bullseye
260 - name: Install rust targets
263 apt-get -y dist-upgrade
264 apt-get -y install git g++ clang faketime zip unzip curl openjdk-11-jdk
265 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh
269 # Temporarily use 1.67.1 to fix https://github.com/rust-lang/rust/issues/108943
270 rustup install 1.67.1
271 rustup default 1.67.1
272 rustup target add armv7-linux-androideabi
273 rustup target add aarch64-linux-android
274 rustup target add i686-linux-android
275 rustup target add x86_64-linux-android
276 - name: Checkout source code
277 uses: actions/checkout@v2
280 - name: Install android NDK compilers
282 git config --global safe.directory '*'
283 curl https://dl.google.com/android/repository/android-ndk-r22b-linux-x86_64.zip > android-ndk-r22b-linux-x86_64.zip
284 if [ "$(sha256sum android-ndk-r22b-linux-x86_64.zip | awk '{ print $1 }')" != "ac3a0421e76f71dd330d0cd55f9d99b9ac864c4c034fc67e0d671d022d4e806b" ]; then
288 unzip android-ndk-r22b-linux-x86_64.zip
289 - name: Install cbindgen
292 cargo install cbindgen
293 - name: Checkout Rust-Lightning and LDK-C-Bindings git
295 git config --global user.email "ldk-ci@example.com"
296 git config --global user.name "LDK CI"
297 # Note this is a different endpoint, as we need one non-upstream commit!
298 git clone https://git.bitcoin.ninja/rust-lightning
300 git checkout origin/2023-02-0.0.114-java-bindings
302 git clone https://github.com/lightningdevkit/ldk-c-bindings
305 - name: Checkout Android AAR binaries and artifacts
307 # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
308 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
309 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
310 RELEASE_PAGE="https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=tree;f=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE};hb=refs/heads/main"
311 SNAPSHOT_LINK="$(curl "$RELEASE_PAGE" | grep snapshot | grep -o 'href="[a-zA-Z0-9/?\.=;\-]*"' | sed 's/href="//' | tr -d '"' | grep snapshot)"
312 curl -o bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
314 ANDROID_PAGE="https://git.bitcoin.ninja/index.cgi?p=ldk-java-bins;a=tree;f=android-artifacts;hb=refs/heads/main"
315 SNAPSHOT_LINK="$(curl "$ANDROID_PAGE" | grep snapshot | grep -o 'href="[a-zA-Z0-9/?\.=;\-]*"' | sed 's/href="//' | tr -d '"' | grep snapshot)"
316 curl -o android-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
318 mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
319 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
320 tar xvvf ../../bins-snapshot.tgz
321 mv ldk-java-bins-*/* ./
322 rm -r ldk-java-bins-*
324 mkdir -p ../android-artifacts
325 cd ../android-artifacts
326 tar xvvf ../../android-snapshot.tgz
327 mv ldk-java-bins-*/* ./
328 rm -r ldk-java-bins-*
329 - name: Build Android aar
332 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
333 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/ldk-java-classes.jar" ./
334 export ANDROID_TOOLCHAIN="$(pwd)/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64"
335 export PATH="$PATH:$ANDROID_TOOLCHAIN/bin"
336 ./android-build.sh ./rust-lightning ./ldk-c-bindings/ ./ldk-java-bins/android-artifacts
337 - name: Check latest library and jars are in bins repo
339 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
340 if ! diff LDK-release.aar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"LDK-release.aar; then
341 apt-get -y install diffoscope
342 diffoscope LDK-release.aar "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/LDK-release.aar"
350 - platform: macos-10.15
353 runs-on: ${{ matrix.platform }}
355 - name: Install other Rust platforms
356 run: rustup target install aarch64-apple-darwin
357 - name: Checkout source code
358 uses: actions/checkout@v2
361 - name: Fetch upstream LLVM/clang snapshot
363 git config --global safe.directory '*'
364 wget -O clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz
365 if [ "$(shasum -a 256 clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz | awk '{ print $1 }')" != "d16b6d536364c5bec6583d12dd7e6cf841b9f508c4430d9ee886726bd9983f1c" ]; then
369 - name: Unpack upstream LLVM+clang and use it by default
371 tar xvvf clang+llvm-15.0.7-x86_64-apple-darwin21.0.tar.xz
372 - name: Install cbindgen
373 run: cargo install cbindgen
374 - name: Checkout Rust-Lightning and LDK-C-Bindings git
376 git config --global user.email "ldk-ci@example.com"
377 git config --global user.name "LDK CI"
378 # Note this is a different endpoint, as we need one non-upstream commit!
379 git clone https://git.bitcoin.ninja/rust-lightning
381 git checkout origin/2023-02-0.0.114-java-bindings
383 git clone https://github.com/lightningdevkit/ldk-c-bindings
386 - name: Rebuild C bindings with upstream clang, and check the sample app builds + links
388 export PATH=`pwd`/clang+llvm-15.0.7-x86_64-apple-darwin21.0/bin:$PATH
391 export CC_x86_64_apple_darwin=clang
392 export CC_aarch64_apple_darwin=clang
393 CC=clang ./genbindings.sh ../rust-lightning true
394 - name: Fetch OpenJDK 18
396 if [ "$(uname -m)" = "arm64" ]; then
397 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
398 if [ "$(shasum -a 256 openjdk-18.0.1.1_macos-aarch64_bin.tar.gz | awk '{ print $1 }')" != "29773ad68063bdad7fbaeb762cd873d3f243e86de380d3ac5335cdb929371fb5" ]; then
402 tar xvvf openjdk-18.0.1.1_macos-aarch64_bin.tar.gz
404 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
405 if [ "$(shasum -a 256 openjdk-18.0.1.1_macos-x64_bin.tar.gz | awk '{ print $1 }')" != "f02d17ec5a387555f8489abc352d973b6c10364409b597046025938e2266d72a" ]; then
409 tar xvvf openjdk-18.0.1.1_macos-x64_bin.tar.gz
411 - name: Checkout latest Linux binaries
413 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
414 echo "Fetching deterministic binaries for LDK-GC ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
415 # Gitweb only allows snapshots of folders by providing the object hash, which we have to extract:
416 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)"
417 wget -O bins-snapshot.tgz "https://git.bitcoin.ninja${SNAPSHOT_LINK}"
418 mkdir -p ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
419 cd ldk-java-bins/"${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}"
420 tar xvvf ../../bins-snapshot.tgz
421 mv ldk-java-bins-*/* ./
423 mkdir -p src/main/resources/
424 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/liblightningjni_Linux-"* src/main/resources/
425 - name: Build Java Release Bindings
427 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
428 export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
429 export PATH=$JAVA_HOME/bin:$PATH
430 export PATH=`pwd`/clang+llvm-15.0.7-x86_64-apple-darwin21.0/bin:$PATH
431 ./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
433 if [ "${{ matrix.platform }}" = "macos-11" ]; then
434 export CC="clang --target=aarch64-apple-darwin"
435 export LDK_TARGET=aarch64-apple-darwin
436 export LDK_TARGET_CPU=apple-a14
437 ./genbindings.sh ./ldk-c-bindings/ "-I$JAVA_HOME/include/ -I$JAVA_HOME/include/darwin -isysroot$(xcrun --show-sdk-path)" false false
438 cat src/main/resources/liblightningjni_MacOSX-aarch64.nativelib > /dev/null
442 - name: Fetch Maven 3.8.4
444 # We don't bother using the upstream mirrors as they remove prior
445 # releases aggressively, causing spurious CI failures when we don't
446 # care about the version used.
447 wget -O apache-maven-3.8.4-bin.tar.gz https://bitcoin.ninja/apache-maven-3.8.4-bin.tar.gz
448 if [ "$(shasum -a 256 apache-maven-3.8.4-bin.tar.gz | awk '{ print $1 }')" != "2cdc9c519427bb20fdc25bef5a9063b790e4abd930e7b14b4e9f4863d6f9f13c" ]; then
452 tar xvvf apache-maven-3.8.4-bin.tar.gz
453 export PATH=apache-maven-3.8.4/bin:$PATH
454 - name: Run Java Tests against built jar
456 export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
457 export PATH=$JAVA_HOME/bin:$PATH
458 mvn -DskipTests=true package
459 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
460 JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
461 mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
464 java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar
465 - name: Check latest release libs are in git
467 if [ "${{ matrix.platform }}" = "macos-11" ]; then
468 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
469 # Sadly, OSX binaries are not currently deterministic, more debugging is needed.
470 diff "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-x86_64.nativelib src/main/resources/liblightningjni_MacOSX-x86_64.nativelib || echo
471 diff "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-aarch64.nativelib src/main/resources/liblightningjni_MacOSX-aarch64.nativelib || echo
473 - name: Upload CI x86_64 build for analysis
474 if: matrix.platform == 'macos-11'
475 uses: actions/upload-artifact@v3.0.0
477 name: liblightningjni_MacOSX-x86_64.nativelib.ci-build
478 path: src/main/resources/liblightningjni_MacOSX-x86_64.nativelib
479 - name: Upload CI aarch64 build for analysis
480 if: matrix.platform == 'macos-11'
481 uses: actions/upload-artifact@v3.0.0
483 name: liblightningjni_MacOSX-aarch64.nativelib.ci-build
484 path: src/main/resources/liblightningjni_MacOSX-aarch64.nativelib
485 - name: Run Java Tests against release bins
487 if [ "${{ matrix.platform }}" != "macos-11" ]; then
488 export LDK_GARBAGECOLLECTED_GIT_OVERRIDE="$(git describe --tag HEAD)"
489 export JAVA_HOME=`pwd`/jdk-18.0.1.1.jdk/Contents/Home
490 export PATH=$JAVA_HOME/bin:$PATH
491 cp "ldk-java-bins/${LDK_GARBAGECOLLECTED_GIT_OVERRIDE}/"liblightningjni_MacOSX-{x86_64,aarch64}.nativelib src/main/resources/
493 mvn -q -B -DskipTests=true package
494 JAR_VERSION=${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}
495 mvn install:install-file -Dfile=target/ldk-java-${JAR_VERSION}.jar -DgroupId=org.lightningdevkit -DartifactId=ldk-java -Dversion=1.0-SNAPSHOT -Dpackaging=jar
498 java -ea -jar target/ldk-java-tests-1.0-SNAPSHOT-jar-with-dependencies.jar