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 valgrind lld git g++ clang
19 - name: Checkout source code
20 uses: actions/checkout@v2
21 - name: Sanity test bindings against Cargo.toml RL
22 working-directory: lightning-c-bindings
24 - name: Install cbindgen
25 run: cargo install --force cbindgen
26 - name: Checkout Rust-Lightning git
27 run: git clone https://github.com/rust-bitcoin/rust-lightning
28 - name: Rebuild bindings without std, and check the sample app builds + links
29 run: ./genbindings.sh ./rust-lightning false
30 - name: Rebuild bindings, and check the sample app builds + links
31 run: ./genbindings.sh ./rust-lightning true
32 - name: Check that the latest bindings are in git
34 git checkout lightning-c-bindings/Cargo.toml # genbindings edits this to update the path
35 if [ "$(git diff)" != "" ]; then
36 # cbindgen's bindings output order can be FS-dependant, so check that the lines are all the same:
37 mv lightning-c-bindings/include/lightning.h lightning-c-bindings/include/lightning.h.new
38 git checkout lightning-c-bindings/include/lightning.h
39 cat lightning-c-bindings/include/lightning.h | grep -v "Generated with cbindgen:[0-9\.]*" | sort > lightning-c-bindings/include/lightning.h.sorted
40 cat lightning-c-bindings/include/lightning.h.new | grep -v "Generated with cbindgen:[0-9\.]*" | sort > lightning-c-bindings/include/lightning.h.new.sorted
41 diff lightning-c-bindings/include/lightning.h.sorted lightning-c-bindings/include/lightning.h.new.sorted
42 [ "$(diff lightning-c-bindings/include/lightning.h.sorted lightning-c-bindings/include/lightning.h.new.sorted)" != "" ] && exit 2