77 strategy :
88 fail-fast : false
99 matrix :
10- platform : [ ubuntu-latest ]
11- toolchain : [ stable,
12- beta,
13- # 1.41.1 is MSRV for Rust-Lightning, lightning-invoice, and lightning-persister
14- 1.41.1,
15- # 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, lightning-background-processor
16- 1.45.2,
17- # 1.47.0 will be the MSRV for no-std builds using hashbrown once core2 is updated
18- 1.47.0]
10+ platform : [ ubuntu-latest, windows-latest, macos-latest ]
11+ toolchain : [ stable, beta ]
1912 include :
2013 - toolchain : stable
21- build-net-tokio : true
22- build-no-std : true
23- build-futures : true
24- build-tx-sync : true
14+ platform : ubuntu-latest
2515 coverage : true
26- - toolchain : stable
27- platform : macos-latest
28- build-net-tokio : true
29- build-no-std : true
30- build-futures : true
31- build-tx-sync : true
32- - toolchain : stable
33- test-custom-message : true
34- - toolchain : beta
35- platform : macos-latest
36- build-net-tokio : true
37- build-no-std : true
38- build-futures : true
39- build-tx-sync : true
40- - toolchain : stable
16+ # 1.48.0 is the MSRV for all crates except lightning-transaction-sync and Win/Mac
17+ - toolchain : 1.48.0
18+ platform : ubuntu-latest
19+ # Windows requires 1.49.0 because that's the MSRV for supported Tokio
20+ - toolchain : 1.49.0
4121 platform : windows-latest
42- build-net-tokio : true
43- build-no-std : true
44- build-futures : true
45- build-tx-sync : false
46- - toolchain : beta
47- platform : windows-latest
48- build-net-tokio : true
49- build-no-std : true
50- build-futures : true
51- build-tx-sync : false
52- - toolchain : beta
53- build-net-tokio : true
54- build-no-std : true
55- build-futures : true
56- build-tx-sync : true
57- - toolchain : beta
58- test-custom-message : true
59- - toolchain : 1.41.1
60- build-no-std : false
61- test-log-variants : true
62- build-futures : false
63- build-tx-sync : false
64- - toolchain : 1.45.2
65- build-net-old-tokio : true
66- build-net-tokio : true
67- build-no-std : false
68- build-futures : true
69- build-tx-sync : false
70- - toolchain : 1.47.0
71- build-futures : true
72- build-no-std : true
73- build-tx-sync : false
22+ # MacOS-latest requires 1.54.0 because that's what's required for linking to work properly
23+ - toolchain : 1.54.0
24+ platform : macos-latest
7425 runs-on : ${{ matrix.platform }}
7526 steps :
7627 - name : Checkout source code
@@ -81,162 +32,24 @@ jobs:
8132 toolchain : ${{ matrix.toolchain }}
8233 override : true
8334 profile : minimal
84- - name : Pin tokio to 1.14 for Rust 1.45
85- if : " matrix.build-net-old-tokio"
86- run : cargo update -p tokio --precise "1.14.0" --verbose
87- env :
88- CARGO_NET_GIT_FETCH_WITH_CLI : " true"
89- - name : Pin tokio to 1.26 for Windows
90- if : " matrix.platform == 'windows-latest'"
91- run : cargo update -p tokio --precise "1.26.0" --verbose
92- env :
93- CARGO_NET_GIT_FETCH_WITH_CLI : " true"
94- - name : Build on Rust ${{ matrix.toolchain }} with net-tokio
95- if : " matrix.build-net-tokio && !matrix.coverage"
96- run : cargo build --verbose --color always
97- - name : Build on Rust ${{ matrix.toolchain }} with net-tokio, and full code-linking for coverage generation
98- if : matrix.coverage
99- run : RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always
100- - name : Build on Rust ${{ matrix.toolchain }}
101- if : " ! matrix.build-net-tokio"
102- run : |
103- cargo build --verbose --color always -p lightning
104- cargo build --verbose --color always -p lightning-invoice
105- cargo build --verbose --color always -p lightning-persister
106- - name : Build on Rust ${{ matrix.toolchain }} with all Log-Limiting features
107- if : matrix.test-log-variants
108- run : |
109- cd lightning
110- for FEATURE in $(cat Cargo.toml | grep '^max_level_' | awk '{ print $1 }'); do
111- cargo build --verbose --color always --features $FEATURE
112- done
113- - name : Build Block Sync Clients on Rust ${{ matrix.toolchain }} with features
114- if : " matrix.build-net-tokio && !matrix.coverage"
115- run : |
116- cd lightning-block-sync
117- cargo build --verbose --color always --features rest-client
118- cargo build --verbose --color always --features rpc-client
119- cargo build --verbose --color always --features rpc-client,rest-client
120- cargo build --verbose --color always --features rpc-client,rest-client,tokio
121- - name : Build Block Sync Clients on Rust ${{ matrix.toolchain }} with features and full code-linking for coverage generation
122- if : matrix.coverage
123- run : |
124- cd lightning-block-sync
125- RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rest-client
126- RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client
127- RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client,rest-client
128- RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client,rest-client,tokio
129- - name : Build Transaction Sync Clients on Rust ${{ matrix.toolchain }} with features
130- if : " matrix.build-tx-sync && !matrix.coverage"
131- run : |
132- cd lightning-transaction-sync
133- cargo build --verbose --color always --features esplora-blocking
134- cargo build --verbose --color always --features esplora-async
135- cargo build --verbose --color always --features esplora-async-https
136- - name : Build transaction sync clients on Rust ${{ matrix.toolchain }} with features and full code-linking for coverage generation
137- if : " matrix.build-tx-sync && matrix.coverage"
35+ - name : Install no-std-check dependencies for ARM Embedded
36+ if : " matrix.platform == 'ubuntu-latest'"
13837 run : |
139- cd lightning-transaction-sync
140- RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features esplora-blocking
141- RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features esplora-async
142- RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features esplora-async-https
143- - name : Test transaction sync clients on Rust ${{ matrix.toolchain }} with features
144- if : " matrix.build-tx-sync"
145- run : |
146- cd lightning-transaction-sync
147- cargo test --verbose --color always --features esplora-blocking
148- cargo test --verbose --color always --features esplora-async
149- cargo test --verbose --color always --features esplora-async-https
150- - name : Test backtrace-debug builds on Rust ${{ matrix.toolchain }}
151- if : " matrix.toolchain == 'stable'"
152- shell : bash # Default on Winblows is powershell
153- run : |
154- cd lightning && RUST_BACKTRACE=1 cargo test --verbose --color always --features backtrace
155- - name : Test on Rust ${{ matrix.toolchain }} with net-tokio
156- if : " matrix.build-net-tokio && !matrix.coverage"
157- run : cargo test --verbose --color always
158- - name : Test on Rust ${{ matrix.toolchain }} with net-tokio, and full code-linking for coverage generation
159- if : matrix.coverage
160- run : RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
161- - name : Test no-std builds on Rust ${{ matrix.toolchain }}
162- if : " matrix.build-no-std && !matrix.coverage"
163- shell : bash # Default on Winblows is powershell
164- run : |
165- for DIR in lightning lightning-invoice lightning-rapid-gossip-sync; do
166- cd $DIR
167- cargo test --verbose --color always --no-default-features --features no-std
168- # check if there is a conflict between no-std and the default std feature
169- cargo test --verbose --color always --features no-std
170- # check that things still pass without grind_signatures
171- # note that outbound_commitment_test only runs in this mode, because of hardcoded signature values
172- cargo test --verbose --color always --no-default-features --features std
173- # check if there is a conflict between no-std and the c_bindings cfg
174- RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always --no-default-features --features=no-std
175- cd ..
176- done
177- # check no-std compatibility across dependencies
178- cd no-std-check
179- cargo check --verbose --color always --features lightning-transaction-sync
180- - name : Build no-std-check on Rust ${{ matrix.toolchain }} for ARM Embedded
181- if : " matrix.build-no-std && matrix.platform == 'ubuntu-latest'"
182- run : |
183- cd no-std-check
18438 rustup target add thumbv7m-none-eabi
18539 sudo apt-get -y install gcc-arm-none-eabi
186- cargo build --target=thumbv7m-none-eabi
187- - name : Test on no-std builds Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
188- if : " matrix.build-no-std && matrix.coverage"
40+ - name : shellcheck the CI script
41+ if : " matrix.platform == 'ubuntu-latest'"
18942 run : |
190- cd lightning
191- RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --no-default-features --features no-std
192- - name : Test futures builds on Rust ${{ matrix.toolchain }}
193- if : " matrix.build-futures && !matrix. coverage"
43+ sudo apt-get -y install shellcheck
44+ shellcheck ci/ci-tests.sh
45+ - name : Run CI script with coverage generation
46+ if : matrix.coverage
19447 shell : bash # Default on Winblows is powershell
195- run : |
196- cd lightning-background-processor
197- cargo test --verbose --color always --no-default-features --features futures
198- - name : Test futures builds on Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
199- if : " matrix.build-futures && matrix.coverage"
48+ run : LDK_COVERAGE_BUILD=true ./ci/ci-tests.sh
49+ - name : Run CI script
50+ if : " !matrix.coverage"
20051 shell : bash # Default on Winblows is powershell
201- run : |
202- cd lightning-background-processor
203- RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --no-default-features --features futures
204- - name : Test on Rust ${{ matrix.toolchain }}
205- if : " ! matrix.build-net-tokio"
206- run : |
207- cargo test --verbose --color always -p lightning
208- cargo test --verbose --color always -p lightning-invoice
209- cargo test --verbose --color always -p lightning-rapid-gossip-sync
210- cargo test --verbose --color always -p lightning-persister
211- cargo test --verbose --color always -p lightning-background-processor
212- - name : Test C Bindings Modifications on Rust ${{ matrix.toolchain }}
213- if : " ! matrix.build-net-tokio"
214- run : |
215- RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always -p lightning
216- RUSTFLAGS="--cfg=c_bindings" cargo test --verbose --color always -p lightning-invoice
217- RUSTFLAGS="--cfg=c_bindings" cargo build --verbose --color always -p lightning-persister
218- RUSTFLAGS="--cfg=c_bindings" cargo build --verbose --color always -p lightning-background-processor
219- - name : Test Block Sync Clients on Rust ${{ matrix.toolchain }} with features
220- if : " matrix.build-net-tokio && !matrix.coverage"
221- run : |
222- cd lightning-block-sync
223- cargo test --verbose --color always --features rest-client
224- cargo test --verbose --color always --features rpc-client
225- cargo test --verbose --color always --features rpc-client,rest-client
226- cargo test --verbose --color always --features rpc-client,rest-client,tokio
227- - name : Test Block Sync Clients on Rust ${{ matrix.toolchain }} with features and full code-linking for coverage generation
228- if : matrix.coverage
229- run : |
230- cd lightning-block-sync
231- RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rest-client
232- RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rpc-client
233- RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rpc-client,rest-client
234- RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --features rpc-client,rest-client,tokio
235- - name : Test Custom Message Macros on Rust ${{ matrix.toolchain }}
236- if : " matrix.test-custom-message"
237- run : |
238- cd lightning-custom-message
239- cargo test --verbose --color always
52+ run : ./ci/ci-tests.sh
24053 - name : Install deps for kcov
24154 if : matrix.coverage
24255 run : |
0 commit comments