]> git.bitcoin.ninja Git - ldk-java/blob - .github/workflows/build.yml
Update autogenerated bindings with correct FREE/clone semantics
[ldk-java] / .github / workflows / build.yml
1 name: Continuous Integration Checks
2
3 on: [push, pull_request]
4
5 jobs:
6   check_bindings:
7     runs-on: ubuntu-latest
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
11     env:
12       TOOLCHAIN: stable
13     steps:
14       - name: Install native Rust toolchain, Valgrind, and build utilitis
15         run: |
16           apt-get update
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
24         run: |
25           git clone https://github.com/rust-bitcoin/rust-lightning
26           cd rust-lightning
27           git remote add matt https://git.bitcoin.ninja/rust-lightning
28           git fetch matt
29           git merge matt/2021-03-java-bindings-base
30           cd ..
31           git clone https://github.com/lightningdevkit/ldk-c-bindings
32       - name: Rebuild C bindings, and check the sample app builds + links
33         run: cd ldk-c-bindings && ./genbindings.sh ../rust-lightning && cd ..
34       - name: Build Java/TS Debug Bindings
35         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
36       - name: Run Java Tests against Debug Bindings
37         run: |
38           rm liblightningjni.so
39           ln -s liblightningjni_debug.so liblightningjni.so
40           export LD_LIBRARY_PATH=.
41           export LD_PRELOAD=/usr/lib/llvm-11/lib/clang/11.0.1/lib/linux/libclang_rt.asan-x86_64.so
42           export ASAN_OPTIONS=detect_leaks=0
43           mvn test
44           git checkout liblightningjni.so
45       - name: Build Java/TS Release Bindings
46         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
47       - name: Check latest headers are in git
48         run: |
49           # For some reason the debug library is not deterministic, this may be fixed in a future rustc
50           git checkout liblightningjni_debug.so
51           git diff --exit-code