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