1 name: Continuous Integration Checks
3 on: [push, pull_request]
8 # Ubuntu's version of rustc uses its own LLVM instead of being a real native package.
9 # This leaves us with an incompatible LLVM version when linking. Instead, use a real OS.
10 container: debian:bullseye
14 - name: Install native Rust toolchain, Valgrind, and build utilitis
17 apt-get -y dist-upgrade
18 apt-get -y install cargo libstd-rust-dev-wasm32 valgrind lld git g++ clang openjdk-11-jdk maven
19 - name: Checkout source code
20 uses: actions/checkout@v2
21 - name: Install cbindgen
22 run: cargo install --force cbindgen
23 - name: Checkout Rust-Lightning and LDK-C-Bindings git
25 git clone https://github.com/rust-bitcoin/rust-lightning
27 git remote add matt https://git.bitcoin.ninja/rust-lightning
29 git merge matt/2021-03-java-bindings-base
31 git clone https://github.com/lightningdevkit/ldk-c-bindings
32 - name: Rebuild C bindings without STD for WASM
35 ./genbindings.sh ../rust-lightning false
36 mv target/wasm32-wasi ./
38 - name: Rebuild C bindings, and check the sample app builds + links
39 run: cd ldk-c-bindings && ./genbindings.sh ../rust-lightning true && mv wasm32-wasi target/ && cd ..
40 - name: Build Java/TS Debug Bindings
41 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
42 - name: Run Java Tests against Debug Bindings
45 ln -s liblightningjni_debug.so liblightningjni.so
46 export LD_LIBRARY_PATH=.
47 export LD_PRELOAD=/usr/lib/llvm-11/lib/clang/11.0.1/lib/linux/libclang_rt.asan-x86_64.so
48 export ASAN_OPTIONS=detect_leaks=0
50 git checkout liblightningjni.so
51 - name: Build Java/TS Release Bindings
52 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/" false false
53 - name: Check latest headers are in git
55 # For some reason the debug library is not deterministic, this may be fixed in a future rustc
56 git checkout liblightningjni_debug.so