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
25 runs-on: ubuntu-latest
27 - name: Checkout source code
28 uses: actions/checkout@v2
29 - name: Install Rust ${{ matrix.toolchain }} toolchain
30 uses: actions-rs/toolchain@v1
32 toolchain: ${{ matrix.toolchain }}
35 - name: Build on Rust ${{ matrix.toolchain }} with net-tokio
36 if: matrix.build-net-tokio
37 run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always
38 - name: Build on Rust ${{ matrix.toolchain }}
39 if: "! matrix.build-net-tokio"
40 run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always -p lightning
41 - name: Test on Rust ${{ matrix.toolchain }} with net-tokio
42 if: matrix.build-net-tokio
43 run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
44 - name: Test on Rust ${{ matrix.toolchain }}
45 if: "! matrix.build-net-tokio"
46 run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always -p lightning
47 - name: Install deps for kcov
51 sudo apt-get -y install binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev
55 wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz
57 cd kcov-master && mkdir build && cd build
60 make install DESTDIR=../../kcov-build
61 cd ../.. && rm -rf kcov-master master.tar.gz
62 - name: Generate coverage report
65 for file in target/debug/lightning-*; do
66 [ -x "${file}" ] || continue;
67 mkdir -p "target/cov/$(basename $file)";
68 ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file";
70 - name: Upload coverage
72 uses: codecov/codecov-action@v1
74 fail_ci_if_error: true
77 runs-on: ubuntu-latest
81 - name: Checkout source code
82 uses: actions/checkout@v2
83 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
84 uses: actions-rs/toolchain@v1
86 toolchain: ${{ env.TOOLCHAIN }}
89 - name: Install dependencies for honggfuzz
92 sudo apt-get -y install build-essential binutils-dev libunwind-dev
93 - name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
94 run: cd fuzz && cargo test --verbose --color always
96 run: cd fuzz && ./ci-fuzz.sh