1 name: Continuous Integration Checks
12 group: ${{ github.workflow }}-${{ github.ref }}
13 cancel-in-progress: true
20 platform: [ ubuntu-latest, windows-latest, macos-latest ]
21 toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates.
22 runs-on: ${{ matrix.platform }}
24 - name: Checkout source code
25 uses: actions/checkout@v3
26 - name: Install Rust ${{ matrix.toolchain }} toolchain
28 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ matrix.toolchain }}
29 rustup override set ${{ matrix.toolchain }}
30 - name: Install no-std-check dependencies for ARM Embedded
31 if: "matrix.platform == 'ubuntu-latest'"
33 rustup target add thumbv7m-none-eabi
34 sudo apt-get -y install gcc-arm-none-eabi
35 - name: Check for unknown cfg tags
36 run: ci/check-cfg-flags.py
37 - name: shellcheck the CI script
38 if: "matrix.platform == 'ubuntu-latest'"
40 sudo apt-get -y install shellcheck
41 shellcheck ci/ci-tests.sh
42 - name: Set RUSTFLAGS to deny warnings
43 if: "matrix.toolchain == '1.63.0'"
44 run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
46 shell: bash # Default on Winblows is powershell
47 run: CI_MINIMIZE_DISK_USAGE=1 ./ci/ci-tests.sh
52 runs-on: ubuntu-latest
54 - name: Checkout source code
55 uses: actions/checkout@v3
58 - name: Install Rust stable toolchain
60 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
61 - name: Run tests with coverage generation
63 cargo install cargo-llvm-cov
64 export RUSTFLAGS="-Clink-dead-code -Coverflow-checks=off"
65 cargo llvm-cov --features rest-client,rpc-client,tokio,futures,serde --codecov --hide-instantiations --output-path=target/codecov.json
66 # Could you use this to fake the coverage report for your PR? Sure.
67 # Will anyone be impressed by your amazing coverage? No
68 # Maybe if codecov wasn't broken we wouldn't need to do this...
69 bash <(curl -s https://codecov.io/bash) -f target/codecov.json -t "f421b687-4dc2-4387-ac3d-dc3b2528af57"
72 runs-on: ubuntu-latest
76 - name: Checkout source code
77 uses: actions/checkout@v3
78 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
80 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
81 rustup override set ${{ env.TOOLCHAIN }}
82 - name: Cache routing graph snapshot
84 uses: actions/cache@v3
86 path: lightning/net_graph-2023-12-10.bin
87 key: ldk-net_graph-v0.0.118-2023-12-10.bin
88 - name: Fetch routing graph snapshot
89 if: steps.cache-graph.outputs.cache-hit != 'true'
91 curl --verbose -L -o lightning/net_graph-2023-12-10.bin https://bitcoin.ninja/ldk-net_graph-v0.0.118-2023-12-10.bin
92 echo "Sha sum: $(sha256sum lightning/net_graph-2023-12-10.bin | awk '{ print $1 }')"
93 if [ "$(sha256sum lightning/net_graph-2023-12-10.bin | awk '{ print $1 }')" != "${EXPECTED_ROUTING_GRAPH_SNAPSHOT_SHASUM}" ]; then
98 EXPECTED_ROUTING_GRAPH_SNAPSHOT_SHASUM: e94b38ef4b3ce683893bf6a3ee28d60cb37c73b059403ff77b7e7458157968c2
99 - name: Cache scorer snapshot
101 uses: actions/cache@v3
103 path: lightning/scorer-2023-12-10.bin
104 key: ldk-scorer-v0.0.118-2023-12-10.bin
105 - name: Fetch scorer snapshot
106 if: steps.cache-scorer.outputs.cache-hit != 'true'
108 curl --verbose -L -o lightning/scorer-2023-12-10.bin https://bitcoin.ninja/ldk-scorer-v0.0.118-2023-12-10.bin
109 echo "Sha sum: $(sha256sum lightning/scorer-2023-12-10.bin | awk '{ print $1 }')"
110 if [ "$(sha256sum lightning/scorer-2023-12-10.bin | awk '{ print $1 }')" != "${EXPECTED_SCORER_SNAPSHOT_SHASUM}" ]; then
115 EXPECTED_SCORER_SNAPSHOT_SHASUM: 570a26bb28870fe1da7e392cdec9fb794718826b04c43ca053d71a8a9bb9be69
116 - name: Fetch rapid graph sync reference input
118 curl --verbose -L -o lightning-rapid-gossip-sync/res/full_graph.lngossip https://bitcoin.ninja/ldk-compressed_graph-285cb27df79-2022-07-21.bin
119 echo "Sha sum: $(sha256sum lightning-rapid-gossip-sync/res/full_graph.lngossip | awk '{ print $1 }')"
120 if [ "$(sha256sum lightning-rapid-gossip-sync/res/full_graph.lngossip | awk '{ print $1 }')" != "${EXPECTED_RAPID_GOSSIP_SHASUM}" ]; then
125 EXPECTED_RAPID_GOSSIP_SHASUM: e0f5d11641c11896d7af3a2246d3d6c3f1720b7d2d17aab321ecce82e6b7deb8
126 - name: Test with Network Graph on Rust ${{ matrix.toolchain }}
129 RUSTFLAGS="--cfg=require_route_graph_test" cargo test
130 RUSTFLAGS="--cfg=require_route_graph_test" cargo test --features hashbrown
132 - name: Run benchmarks on Rust ${{ matrix.toolchain }}
135 RUSTFLAGS="--cfg=ldk_bench --cfg=require_route_graph_test" cargo bench
136 - name: Run benchmarks with hashbrown on Rust ${{ matrix.toolchain }}
139 RUSTFLAGS="--cfg=ldk_bench --cfg=require_route_graph_test" cargo bench --features hashbrown
142 runs-on: ubuntu-latest
146 - name: Checkout source code
147 uses: actions/checkout@v3
150 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
152 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
153 rustup override set ${{ env.TOOLCHAIN }}
154 - name: Fetch full tree and rebase on upstream
156 git remote add upstream https://github.com/lightningdevkit/rust-lightning
158 export GIT_COMMITTER_EMAIL="rl-ci@example.com"
159 export GIT_COMMITTER_NAME="RL CI"
160 git rebase upstream/main
161 - name: For each commit, run cargo check (including in fuzz)
162 run: ci/check-each-commit.sh upstream/main
165 runs-on: ubuntu-latest
169 - name: Checkout source code
170 uses: actions/checkout@v3
173 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
175 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
176 rustup override set ${{ env.TOOLCHAIN }}
177 - name: Run cargo check for release build.
179 cargo check --release
180 cargo check --no-default-features --features=no-std --release
181 cargo check --no-default-features --features=futures,std --release
183 - name: Run cargo check for Taproot build.
185 cargo check --release
186 cargo check --no-default-features --features=no-std --release
187 cargo check --no-default-features --features=futures,std --release
190 RUSTFLAGS: '--cfg=taproot'
191 RUSTDOCFLAGS: '--cfg=taproot'
194 runs-on: ubuntu-latest
198 - name: Checkout source code
199 uses: actions/checkout@v3
200 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
202 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
203 rustup override set ${{ env.TOOLCHAIN }}
204 - name: Install dependencies for honggfuzz
207 sudo apt-get -y install build-essential binutils-dev libunwind-dev
208 - name: Pin the regex dependency
210 cd fuzz && cargo update -p regex --precise "1.9.6" --verbose && cd ..
211 - name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
212 run: cd fuzz && RUSTFLAGS="--cfg=fuzzing --cfg=secp256k1_fuzz --cfg=hashes_fuzz" cargo test --verbose --color always
214 run: cd fuzz && ./ci-fuzz.sh && cd ..
217 runs-on: ubuntu-latest
221 - name: Checkout source code
222 uses: actions/checkout@v3
223 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
225 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
226 rustup override set ${{ env.TOOLCHAIN }}
227 - name: Install clippy
229 rustup component add clippy
230 - name: Run default clippy linting
232 cargo clippy -- -Aclippy::erasing_op -Aclippy::never_loop -Aclippy::if_same_then_else -Dclippy::try_err
235 runs-on: ubuntu-latest
239 - name: Checkout source code
240 uses: actions/checkout@v3
241 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
243 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
244 rustup override set ${{ env.TOOLCHAIN }}
245 - name: Install rustfmt
247 rustup component add rustfmt
248 - name: Run rustfmt checks