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
28 RUSTFLAGS="--cfg=c_bindings" cargo check --features std
29 - name: Install cbindgen
30 run: cargo install --force cbindgen
31 - name: Checkout Rust-Lightning git
33 git clone https://github.com/rust-bitcoin/rust-lightning
35 git checkout 0.0.105-bindings
36 - name: Rebuild bindings without std, and check the sample app builds + links
37 run: ./genbindings.sh ./rust-lightning false
38 - name: Rebuild bindings, and check the sample app builds + links
39 run: ./genbindings.sh ./rust-lightning true
40 - name: Check that the latest bindings are in git
42 git checkout lightning-c-bindings/Cargo.toml # genbindings edits this to update the path
43 if [ "$(git diff)" != "" ]; then
44 # cbindgen's bindings output order can be FS-dependant, so check that the lines are all the same:
45 mv lightning-c-bindings/include/lightning.h lightning-c-bindings/include/lightning.h.new
46 git checkout lightning-c-bindings/include/lightning.h
47 cat lightning-c-bindings/include/lightning.h | grep -v "Generated with cbindgen:[0-9\.]*" | sort > lightning-c-bindings/include/lightning.h.sorted
48 cat lightning-c-bindings/include/lightning.h.new | grep -v "Generated with cbindgen:[0-9\.]*" | sort > lightning-c-bindings/include/lightning.h.new.sorted
49 diff lightning-c-bindings/include/lightning.h.sorted lightning-c-bindings/include/lightning.h.new.sorted
50 [ "$(diff lightning-c-bindings/include/lightning.h.sorted lightning-c-bindings/include/lightning.h.new.sorted)" != "" ] && exit 2
58 - platform: macos-10.15
60 runs-on: ${{ matrix.platform }}
64 - name: Install other Rust platforms
65 run: rustup target install aarch64-apple-darwin
66 - name: Fetch upstream LLVM/clang snapshot
68 wget -O clang+llvm-12.0.0-x86_64-apple-darwin.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-x86_64-apple-darwin.tar.xz
69 if [ "$(shasum -a 256 clang+llvm-12.0.0-x86_64-apple-darwin.tar.xz | awk '{ print $1 }')" != "7bc2259bf75c003f644882460fc8e844ddb23b27236fe43a2787870a4cd8ab50" ]; then
73 - name: Unpack upstream LLVM+clang and use it by default
75 tar xvvf clang+llvm-12.0.0-x86_64-apple-darwin.tar.xz
76 - name: Checkout source code
77 uses: actions/checkout@v2
80 - name: Install cbindgen
81 run: cargo install --force cbindgen
82 - name: Checkout Rust-Lightning git
84 git clone https://github.com/rust-bitcoin/rust-lightning
86 git checkout 0.0.105-bindings
87 - name: Rebuild bindings using Apple clang, and check the sample app builds + links
88 run: ./genbindings.sh ./rust-lightning true
89 - name: Rebuild bindings using upstream clang, and check the sample app builds + links
91 export PATH=`pwd`/clang+llvm-12.0.0-x86_64-apple-darwin/bin:$PATH
92 CC=clang ./genbindings.sh ./rust-lightning true