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
43 shell: bash # Default on Winblows is powershell
44 run: CI_MINIMIZE_DISK_USAGE=1 ./ci/ci-tests.sh
49 runs-on: ubuntu-latest
51 - name: Checkout source code
52 uses: actions/checkout@v3
55 - name: Install Rust stable toolchain
57 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
58 - name: Run tests with coverage generation
60 cargo install cargo-llvm-cov
61 export RUSTFLAGS="-Clink-dead-code -Coverflow-checks=off"
62 cargo llvm-cov --features rest-client,rpc-client,tokio,futures,serde --codecov --hide-instantiations --output-path=target/codecov.json
63 # Could you use this to fake the coverage report for your PR? Sure.
64 # Will anyone be impressed by your amazing coverage? No
65 # Maybe if codecov wasn't broken we wouldn't need to do this...
66 bash <(curl -s https://codecov.io/bash) -f target/codecov.json -t "f421b687-4dc2-4387-ac3d-dc3b2528af57"
69 runs-on: ubuntu-latest
73 - name: Checkout source code
74 uses: actions/checkout@v3
75 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
77 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
78 rustup override set ${{ env.TOOLCHAIN }}
79 - name: Cache routing graph snapshot
81 uses: actions/cache@v3
83 path: lightning/net_graph-2023-01-18.bin
84 key: ldk-net_graph-v0.0.113-2023-01-18.bin
85 - name: Fetch routing graph snapshot
86 if: steps.cache-graph.outputs.cache-hit != 'true'
88 curl --verbose -L -o lightning/net_graph-2023-01-18.bin https://bitcoin.ninja/ldk-net_graph-v0.0.113-2023-01-18.bin
89 echo "Sha sum: $(sha256sum lightning/net_graph-2023-01-18.bin | awk '{ print $1 }')"
90 if [ "$(sha256sum lightning/net_graph-2023-01-18.bin | awk '{ print $1 }')" != "${EXPECTED_ROUTING_GRAPH_SNAPSHOT_SHASUM}" ]; then
95 EXPECTED_ROUTING_GRAPH_SNAPSHOT_SHASUM: da6066f2bddcddbe7d8a6debbd53545697137b310bbb8c4911bc8c81fc5ff48c
96 - name: Fetch rapid graph sync reference input
98 curl --verbose -L -o lightning-rapid-gossip-sync/res/full_graph.lngossip https://bitcoin.ninja/ldk-compressed_graph-285cb27df79-2022-07-21.bin
99 echo "Sha sum: $(sha256sum lightning-rapid-gossip-sync/res/full_graph.lngossip | awk '{ print $1 }')"
100 if [ "$(sha256sum lightning-rapid-gossip-sync/res/full_graph.lngossip | awk '{ print $1 }')" != "${EXPECTED_RAPID_GOSSIP_SHASUM}" ]; then
105 EXPECTED_RAPID_GOSSIP_SHASUM: e0f5d11641c11896d7af3a2246d3d6c3f1720b7d2d17aab321ecce82e6b7deb8
106 - name: Test with Network Graph on Rust ${{ matrix.toolchain }}
109 RUSTFLAGS="--cfg=require_route_graph_test" cargo test
110 RUSTFLAGS="--cfg=require_route_graph_test" cargo test --features hashbrown
112 - name: Run benchmarks on Rust ${{ matrix.toolchain }}
115 RUSTFLAGS="--cfg=ldk_bench --cfg=require_route_graph_test" cargo bench
116 - name: Run benchmarks with hashbrown on Rust ${{ matrix.toolchain }}
119 RUSTFLAGS="--cfg=ldk_bench --cfg=require_route_graph_test" cargo bench --features hashbrown
122 runs-on: ubuntu-latest
126 - name: Checkout source code
127 uses: actions/checkout@v3
130 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
132 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
133 rustup override set ${{ env.TOOLCHAIN }}
134 - name: Fetch full tree and rebase on upstream
136 git remote add upstream https://github.com/lightningdevkit/rust-lightning
138 export GIT_COMMITTER_EMAIL="rl-ci@example.com"
139 export GIT_COMMITTER_NAME="RL CI"
140 git rebase upstream/main
141 - name: For each commit, run cargo check (including in fuzz)
142 run: ci/check-each-commit.sh upstream/main
145 runs-on: ubuntu-latest
149 - name: Checkout source code
150 uses: actions/checkout@v3
153 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
155 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
156 rustup override set ${{ env.TOOLCHAIN }}
157 - name: Run cargo check for release build.
159 cargo check --release
160 cargo check --no-default-features --features=no-std --release
161 cargo check --no-default-features --features=futures,std --release
163 - name: Run cargo check for Taproot build.
165 cargo check --release
166 cargo check --no-default-features --features=no-std --release
167 cargo check --no-default-features --features=futures,std --release
170 RUSTFLAGS: '--cfg=taproot'
171 RUSTDOCFLAGS: '--cfg=taproot'
174 runs-on: ubuntu-latest
178 - name: Checkout source code
179 uses: actions/checkout@v3
180 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
182 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
183 rustup override set ${{ env.TOOLCHAIN }}
184 - name: Install dependencies for honggfuzz
187 sudo apt-get -y install build-essential binutils-dev libunwind-dev
188 - name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
189 run: cd fuzz && RUSTFLAGS="--cfg=fuzzing" cargo test --verbose --color always
191 run: cd fuzz && ./ci-fuzz.sh && cd ..
192 - name: Run lightning-invoice fuzzers
193 run: cd lightning-invoice/fuzz && RUSTFLAGS="--cfg=fuzzing" cargo test --verbose && ./ci-fuzz.sh
196 runs-on: ubuntu-latest
200 - name: Checkout source code
201 uses: actions/checkout@v3
202 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
204 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
205 rustup override set ${{ env.TOOLCHAIN }}
206 - name: Install clippy
208 rustup component add clippy
209 - name: Run default clippy linting
211 cargo clippy -- -Aclippy::erasing_op -Aclippy::never_loop -Aclippy::if_same_then_else -Dclippy::try_err