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 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: Test on Rust ${{ matrix.toolchain }} with net-tokio
43 if: matrix.build-net-tokio
44 run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
45 - name: Test on Rust ${{ matrix.toolchain }}
46 if: "! matrix.build-net-tokio"
47 run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always -p lightning
48 - name: Run mutagen tests on ${{ matrix.toolchain }}
49 if: matrix.run-mutagen
50 # Run mutagen on nightly with TheBlueMatt's fork which exits with non-0 status
51 # if any mutations resulted in anything except test failures to prevent regressions.
53 rm -rf mutagen && git clone https://github.com/TheBlueMatt/mutagen
54 cargo install --force --path mutagen/mutagen-runner
56 ~/.cargo/bin/cargo-mutagen --features mutation_testing
57 # Generate code cov information on Rust 1.39.0
58 - name: Install deps for kcov
62 sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
66 wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
68 cd kcov-master && mkdir build && cd build
71 make install DESTDIR=../../kcov-build
72 cd ../.. && rm -rf kcov-master master.tar.gz
73 - name: Generate coverage report
76 for file in target/debug/lightning-*; do
77 [ -x "${file}" ] || continue;
78 mkdir -p "target/cov/$(basename $file)";
79 ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
81 - name: Upload coverage
83 uses: codecov/codecov-action@v1
85 fail_ci_if_error: true
88 runs-on: ubuntu-latest
92 - name: Checkout source code
93 uses: actions/checkout@v2
94 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
95 uses: actions-rs/toolchain@v1
97 toolchain: ${{ env.TOOLCHAIN }}
100 - name: Install dependencies for honggfuzz
103 sudo apt-get -y install build-essential binutils-dev libunwind-dev
104 - name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
105 run: cd fuzz && cargo test --verbose --color always
107 run: cd fuzz && ./ci-fuzz.sh