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: shellcheck the CI script
36 if: "matrix.platform == 'ubuntu-latest'"
38 sudo apt-get -y install shellcheck
39 shellcheck ci/ci-tests.sh
41 shell: bash # Default on Winblows is powershell
42 run: CI_MINIMIZE_DISK_USAGE=1 ./ci/ci-tests.sh
47 runs-on: ubuntu-latest
49 - name: Checkout source code
50 uses: actions/checkout@v3
53 - name: Install Rust stable toolchain
55 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
56 - name: Run tests with coverage generation
58 cargo install cargo-llvm-cov
59 export RUSTFLAGS="-Clink-dead-code -Coverflow-checks=off"
60 cargo llvm-cov --features rest-client,rpc-client,tokio,futures,serde --codecov --hide-instantiations --output-path=target/codecov.json
61 # Could you use this to fake the coverage report for your PR? Sure.
62 # Will anyone be impressed by your amazing coverage? No
63 # Maybe if codecov wasn't broken we wouldn't need to do this...
64 bash <(curl -s https://codecov.io/bash) -f target/codecov.json -t "f421b687-4dc2-4387-ac3d-dc3b2528af57"
67 runs-on: ubuntu-latest
71 - name: Checkout source code
72 uses: actions/checkout@v3
73 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
75 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
76 rustup override set ${{ env.TOOLCHAIN }}
77 - name: Cache routing graph snapshot
79 uses: actions/cache@v3
81 path: lightning/net_graph-2023-01-18.bin
82 key: ldk-net_graph-v0.0.113-2023-01-18.bin
83 - name: Fetch routing graph snapshot
84 if: steps.cache-graph.outputs.cache-hit != 'true'
86 curl --verbose -L -o lightning/net_graph-2023-01-18.bin https://bitcoin.ninja/ldk-net_graph-v0.0.113-2023-01-18.bin
87 echo "Sha sum: $(sha256sum lightning/net_graph-2023-01-18.bin | awk '{ print $1 }')"
88 if [ "$(sha256sum lightning/net_graph-2023-01-18.bin | awk '{ print $1 }')" != "${EXPECTED_ROUTING_GRAPH_SNAPSHOT_SHASUM}" ]; then
93 EXPECTED_ROUTING_GRAPH_SNAPSHOT_SHASUM: da6066f2bddcddbe7d8a6debbd53545697137b310bbb8c4911bc8c81fc5ff48c
94 - name: Fetch rapid graph sync reference input
96 curl --verbose -L -o lightning-rapid-gossip-sync/res/full_graph.lngossip https://bitcoin.ninja/ldk-compressed_graph-285cb27df79-2022-07-21.bin
97 echo "Sha sum: $(sha256sum lightning-rapid-gossip-sync/res/full_graph.lngossip | awk '{ print $1 }')"
98 if [ "$(sha256sum lightning-rapid-gossip-sync/res/full_graph.lngossip | awk '{ print $1 }')" != "${EXPECTED_RAPID_GOSSIP_SHASUM}" ]; then
103 EXPECTED_RAPID_GOSSIP_SHASUM: e0f5d11641c11896d7af3a2246d3d6c3f1720b7d2d17aab321ecce82e6b7deb8
104 - name: Test with Network Graph on Rust ${{ matrix.toolchain }}
107 RUSTFLAGS="--cfg=require_route_graph_test" cargo test
108 RUSTFLAGS="--cfg=require_route_graph_test" cargo test --features hashbrown
110 - name: Run benchmarks on Rust ${{ matrix.toolchain }}
113 RUSTFLAGS="--cfg=ldk_bench --cfg=require_route_graph_test" cargo bench
114 - name: Run benchmarks with hashbrown on Rust ${{ matrix.toolchain }}
117 RUSTFLAGS="--cfg=ldk_bench --cfg=require_route_graph_test" cargo bench --features hashbrown
120 runs-on: ubuntu-latest
124 - name: Checkout source code
125 uses: actions/checkout@v3
128 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
130 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
131 rustup override set ${{ env.TOOLCHAIN }}
132 - name: Fetch full tree and rebase on upstream
134 git remote add upstream https://github.com/lightningdevkit/rust-lightning
136 export GIT_COMMITTER_EMAIL="rl-ci@example.com"
137 export GIT_COMMITTER_NAME="RL CI"
138 git rebase upstream/main
139 - name: For each commit, run cargo check (including in fuzz)
140 run: ci/check-each-commit.sh upstream/main
143 runs-on: ubuntu-latest
147 - name: Checkout source code
148 uses: actions/checkout@v3
151 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
153 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
154 rustup override set ${{ env.TOOLCHAIN }}
155 - name: Run cargo check for release build.
157 cargo check --release
158 cargo check --no-default-features --features=no-std --release
159 cargo check --no-default-features --features=futures,std --release
161 - name: Run cargo check for Taproot build.
163 cargo check --release
164 cargo check --no-default-features --features=no-std --release
165 cargo check --no-default-features --features=futures,std --release
168 RUSTFLAGS: '--cfg=taproot'
169 RUSTDOCFLAGS: '--cfg=taproot'
172 runs-on: ubuntu-latest
176 - name: Checkout source code
177 uses: actions/checkout@v3
178 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
180 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
181 rustup override set ${{ env.TOOLCHAIN }}
182 - name: Install dependencies for honggfuzz
185 sudo apt-get -y install build-essential binutils-dev libunwind-dev
186 - name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
187 run: cd fuzz && RUSTFLAGS="--cfg=fuzzing" cargo test --verbose --color always
189 run: cd fuzz && ./ci-fuzz.sh && cd ..
190 - name: Run lightning-invoice fuzzers
191 run: cd lightning-invoice/fuzz && RUSTFLAGS="--cfg=fuzzing" cargo test --verbose && ./ci-fuzz.sh
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 clippy
206 rustup component add clippy
207 - name: Run default clippy linting
209 cargo clippy -- -Aclippy::erasing_op -Aclippy::never_loop -Aclippy::if_same_then_else -Dclippy::try_err