1 name: Continuous Integration Checks
3 on: [push, pull_request]
11 # 1.22.0 is MSRV for rust-lightning in general:
13 # 1.34.2 is Debian stable
15 # 1.39.0 is MSRV for lightning-net-tokio and lightning-block-sync and generates coverage
26 runs-on: ubuntu-latest
28 - name: Checkout source code
29 uses: actions/checkout@v2
30 - name: Install Rust ${{ matrix.toolchain }} toolchain
31 uses: actions-rs/toolchain@v1
33 toolchain: ${{ matrix.toolchain }}
36 - name: Build on Rust ${{ matrix.toolchain }} with net-tokio
37 if: matrix.build-net-tokio
38 run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always
39 - name: Build on Rust ${{ matrix.toolchain }}
40 if: "! matrix.build-net-tokio"
41 run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always -p lightning
42 - name: Build Block Sync Clients on Rust ${{ matrix.toolchain }} with features
43 if: matrix.build-net-tokio
45 cd lightning-block-sync
46 RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rest-client
47 RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client
48 RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client,rest-client
49 RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always --features rpc-client,rest-client,tokio
51 - name: Test on Rust ${{ matrix.toolchain }} with net-tokio
52 if: matrix.build-net-tokio
53 run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
54 - name: Test on Rust ${{ matrix.toolchain }}
55 if: "! matrix.build-net-tokio"
56 run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always -p lightning
57 - name: Run mutagen tests on ${{ matrix.toolchain }}
58 if: matrix.run-mutagen
59 # Run mutagen on nightly with TheBlueMatt's fork which exits with non-0 status
60 # if any mutations resulted in anything except test failures to prevent regressions.
62 rm -rf mutagen && git clone https://github.com/TheBlueMatt/mutagen
63 cargo install --force --path mutagen/mutagen-runner
65 ~/.cargo/bin/cargo-mutagen --features mutation_testing
66 # Generate code cov information on Rust 1.39.0
67 - name: Install deps for kcov
71 sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
75 wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
77 cd kcov-master && mkdir build && cd build
80 make install DESTDIR=../../kcov-build
81 cd ../.. && rm -rf kcov-master master.tar.gz
82 - name: Generate coverage report
85 for file in target/debug/lightning-*; do
86 [ -x "${file}" ] || continue;
87 mkdir -p "target/cov/$(basename $file)";
88 ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
90 - name: Upload coverage
92 uses: codecov/codecov-action@v1
94 fail_ci_if_error: true
97 runs-on: ubuntu-latest
101 - name: Checkout source code
102 uses: actions/checkout@v2
103 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
104 uses: actions-rs/toolchain@v1
106 toolchain: ${{ env.TOOLCHAIN }}
109 - name: Install dependencies for honggfuzz
112 sudo apt-get -y install build-essential binutils-dev libunwind-dev
113 - name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
114 run: cd fuzz && cargo test --verbose --color always
116 run: cd fuzz && ./ci-fuzz.sh