1
1
name : Check Bindings
2
2
3
- on : [ push, pull_request ]
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
4
8
5
9
jobs :
6
10
check_bindings :
@@ -13,27 +17,20 @@ jobs:
13
17
uses : actions/checkout@v2
14
18
- name : Checkout Rust-Lightning and LDK-C-Bindings git
15
19
run : |
16
- cd bindings/LDK
17
- ls -ll
18
- cd ../../ci
20
+ cd ./ci
19
21
git config --global user.email "[email protected] "
20
22
git config --global user.name "LDK CI"
21
23
# Note this is a different endpoint, as we need one non-upstream commit!
22
24
# git clone https://git.bitcoin.ninja/rust-lightning
23
25
# git clone https://github.com/TheBlueMatt/rust-lightning
24
- # git clone --branch 2021-03-java-bindings-base https://github.com/TheBlueMatt/rust-lightning
25
- git clone --branch 2022-05-107-bindings-scratch https://github.com/TheBlueMatt/rust-lightning
26
+ git clone --branch 2022-06-108-java-bindings https://github.com/TheBlueMatt/rust-lightning
26
27
cd rust-lightning
27
- # git checkout origin/2021-03-java-bindings-base
28
- # git checkout v0.0.100
29
- # git checkout 8966f8d3d4911e034621c6d3c3d20140d3a7e76a
30
28
echo "rust-lightning commit hash:"
31
29
git rev-parse HEAD
32
30
cd ..
33
- # git clone https://github.com/lightningdevkit/ldk-c-bindings
34
- git clone https://github.com/TheBlueMatt/ldk-c-bindings
31
+ git clone --branch v0.0.108.2 https://github.com/lightningdevkit/ldk-c-bindings
32
+ # git clone https://github.com/TheBlueMatt/ldk-c-bindings
35
33
cd ldk-c-bindings
36
- # git checkout 1bb5ae1b34aeb74009b7b4b5ebefc957cddc30a6
37
34
echo "ldk-c-bindings commit hash:"
38
35
git rev-parse HEAD
39
36
- name : Install native Rust toolchain, Valgrind, and build utilities
59
56
cp ldk-c-bindings/ldk-net/ldk_net.c ./LDKSwift/Sources/LDKHeaders/
60
57
- name : Set up Python
61
58
uses : actions/setup-python@v2
62
- - name : Fix header files
63
- run : |
64
- cd ci
65
- python ./fix_header_includes.py
66
59
- name : Generate (copy for debugging) Swift bindings and copy batteries
67
60
run : |
68
61
pwd
@@ -71,22 +64,15 @@ jobs:
71
64
# TODO: switch back to generation method after debugging
72
65
# mkdir -p ci/LDKSwift/Sources/LDKSwift
73
66
# cp -a bindings/LDK/. ci/LDKSwift/Sources/LDKSwift
74
-
75
- cp -R bindings/batteries ci/LDKSwift/Sources/LDKSwift
76
67
env :
77
68
LDK_SWIFT_GENERATOR_INPUT_HEADER_PATH : ci/ldk-c-bindings/lightning-c-bindings/include/lightning.h
78
- LDK_SWIFT_GENERATOR_OUTPUT_DIRECTORY_PATH : ci/LDKSwift/Sources/LDKSwift
69
+ LDK_SWIFT_GENERATOR_OUTPUT_DIRECTORY_PATH : ci/LDKSwift/Sources/LDKSwift/bindings
79
70
- name : Check that the latest auto-generated Swift files are in the repo
80
71
run : |
81
72
python ./ # Generate bindings into local directory
82
- python ci/walker.py bindings/LDK
83
- git diff --exit-code bindings/LDK ':(exclude)bindings/LDK/Bindings.swift'
73
+ git diff --exit-code ci/LDKSwift/Sources/LDKSwift ':(exclude)ci/LDKSwift/Sources/LDKSwift/bindings/Bindings.swift'
84
74
env :
85
75
LDK_SWIFT_GENERATOR_INPUT_HEADER_PATH : ci/ldk-c-bindings/lightning-c-bindings/include/lightning.h
86
- - name : Fix Swift files
87
- run : |
88
- cd ci
89
- python ./fix_swift_imports.py
90
76
- name : Install Swift Toolchain
91
77
run : |
92
78
curl --verbose -L -o swift-5.6-RELEASE-ubuntu20.04.tar.gz https://download.swift.org/swift-5.6-release/ubuntu2004/swift-5.6-RELEASE/swift-5.6-RELEASE-ubuntu20.04.tar.gz
@@ -104,58 +90,21 @@ jobs:
104
90
cd ci/LDKSwift
105
91
../../swift-5.6-RELEASE-ubuntu20.04/usr/bin/swift build
106
92
env :
107
- LDK_C_BINDINGS_BASE : /home/runner/work/ldk-swift/ldk-swift/ldk-c-bindings
93
+ LDK_C_BINDINGS_BASE : /home/runner/work/ldk-swift/ldk-swift/ci/ ldk-c-bindings
108
94
LLVM_CLANG_ASAN_PATH : /usr/lib/llvm-11/lib/clang/11.0.0/lib/linux/libclang_rt.asan-x86_64.a
109
95
RUST_BACKTRACE : 1
110
96
- name : Test Swift bindings package without address sanitizer
111
97
run : |
112
- python ci/toggle_address_sanitation_library.py off
113
98
cd ci/LDKSwift
114
99
../../swift-5.6-RELEASE-ubuntu20.04/usr/bin/swift test -v
115
100
env :
116
101
LDK_C_BINDINGS_BASE : /home/runner/work/ldk-swift/ldk-swift/ci/ldk-c-bindings
117
- LLVM_CLANG_ASAN_PATH : /usr/lib/llvm-11/lib/clang/11.0.0/lib/linux/libclang_rt.asan-x86_64.a
118
102
RUST_BACKTRACE : 1
119
- - name : Archive code coverage results
120
- uses : actions/upload-artifact@v3
121
- with :
122
- name : ci_archive
123
- path : ci
124
-
125
- test_bindings_with_sanitizer :
126
- name : Test Bindings with Sanitizer
127
- runs-on : ubuntu-20.04
128
- needs : check_bindings
129
- steps :
130
- - name : Download code coverage results archive
131
- uses : actions/download-artifact@v3
132
- with :
133
- name : ci_archive
134
- path : ci
135
- - name : Set up Python
136
- uses : actions/setup-python@v2
137
- - name : Install Swift Toolchain
138
- run : |
139
- curl --verbose -L -o swift-5.6-RELEASE-ubuntu20.04.tar.gz https://download.swift.org/swift-5.6-release/ubuntu2004/swift-5.6-RELEASE/swift-5.6-RELEASE-ubuntu20.04.tar.gz
140
- echo "Sha sum: $(sha256sum swift-5.6-RELEASE-ubuntu20.04.tar.gz | awk '{ print $1 }')"
141
- if [ "$(sha256sum swift-5.6-RELEASE-ubuntu20.04.tar.gz | awk '{ print $1 }')" != "${EXPECTED_SWIFT_SHASUM}" ]; then
142
- echo "Bad hash"
143
- echo "Contents: \n$(cat swift-5.6-RELEASE-ubuntu20.04.tar.gz)"
144
- exit 1
145
- fi
146
- tar xvvf swift-5.6-RELEASE-ubuntu20.04.tar.gz
147
- env :
148
- EXPECTED_SWIFT_SHASUM : 3f0d926bfc08eea00a69b1d992f2ab5e08155d97476096a3ef959fe7c4cbd58b
149
- - name : Install Valgrind and build utilities
150
- run : |
151
- sudo apt-get update
152
- sudo apt-get -y dist-upgrade
153
- sudo apt-get -y install valgrind lld g++ clang
154
103
- name : Test Swift bindings package with address sanitizer
104
+ continue-on-error : true
155
105
run : |
156
- python ci/toggle_address_sanitation_library.py on
157
106
cd ci/LDKSwift
158
- ../../swift-5.6-RELEASE-ubuntu20.04/usr/bin/swift test -Xswiftc -suppress-warnings
107
+ ../../swift-5.6-RELEASE-ubuntu20.04/usr/bin/swift test -v
159
108
env :
160
109
LDK_C_BINDINGS_BASE : /home/runner/work/ldk-swift/ldk-swift/ci/ldk-c-bindings
161
110
LLVM_CLANG_ASAN_PATH : /usr/lib/llvm-11/lib/clang/11.0.0/lib/linux/libclang_rt.asan-x86_64.a
0 commit comments