@@ -17,11 +17,16 @@ jobs:
17
17
include :
18
18
- toolchain : stable
19
19
build-net-tokio : true
20
+ build-bindings : true
20
21
- toolchain : beta
21
22
build-net-tokio : true
23
+ build-bindings : true
22
24
- toolchain : 1.39.0
23
25
build-net-tokio : true
26
+ build-bindings : true
24
27
coverage : true
28
+ - toolchain : 1.34.2
29
+ build-bindings : true
25
30
runs-on : ubuntu-latest
26
31
steps :
27
32
- name : Checkout source code
38
43
- name : Build on Rust ${{ matrix.toolchain }}
39
44
if : " ! matrix.build-net-tokio"
40
45
run : RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always -p lightning
46
+ - name : Build bindings on Rust ${{ matrix.toolchain }}
47
+ if : matrix.build-bindings
48
+ run : RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always -p lightning-c-bindings
41
49
- name : Test on Rust ${{ matrix.toolchain }} with net-tokio
42
50
if : matrix.build-net-tokio
43
51
run : RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
@@ -94,3 +102,33 @@ jobs:
94
102
run : cd fuzz && cargo test --verbose --color always
95
103
- name : Run fuzzers
96
104
run : cd fuzz && ./ci-fuzz.sh
105
+
106
+ check_bindings :
107
+ runs-on : ubuntu-latest
108
+ env :
109
+ TOOLCHAIN : stable
110
+ steps :
111
+ - name : Checkout source code
112
+ uses : actions/checkout@v2
113
+ - name : Install Rust ${{ env.TOOLCHAIN }} toolchain
114
+ uses : actions-rs/toolchain@v1
115
+ with :
116
+ toolchain : ${{ env.TOOLCHAIN }}
117
+ override : true
118
+ profile : minimal
119
+ - name : Install cbindgen
120
+ run : cargo install --force cbindgen
121
+ - name : Rebuild bindings, and check the sample app builds + links
122
+ run : ./genbindings.sh
123
+ - name : Check that the latest bindings are in git
124
+ run : |
125
+ if [ "$(git diff)" != "" ]; then
126
+ git diff
127
+ # cbindgen's bindings output order can be FS-dependant, so check that the lines are all the same:
128
+ mv lightning-c-bindings/include/lightning.h lightning-c-bindings/include/lightning.h.new
129
+ git checkout lightning-c-bindings/include/lightning.h
130
+ cat lightning-c-bindings/include/lightning.h | sort > lightning-c-bindings/include/lightning.h.sorted
131
+ cat lightning-c-bindings/include/lightning.h.new | sort > lightning-c-bindings/include/lightning.h.new.sorted
132
+ [ "$(diff lightning-c-bindings/include/lightning.h.sorted lightning-c-bindings/include/lightning.h.new.sorted)" != "" ] && exit 2
133
+ [ "$(git diff)" != "" ] && exit 1
134
+ fi
0 commit comments