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 # Could you use this to fake the coverage report for your PR? Sure.
75 # Will anyone be impressed by your amazing coverage? No
76 # Maybe if codecov wasn't broken we wouldn't need to do this...
77 token: f421b687-4dc2-4387-ac3d-dc3b2528af57
78 fail_ci_if_error: true
81 runs-on: ubuntu-latest
85 - name: Checkout source code
86 uses: actions/checkout@v2
87 - name: Install Rust ${{ env.TOOLCHAIN }} toolchain
88 uses: actions-rs/toolchain@v1
90 toolchain: ${{ env.TOOLCHAIN }}
93 - name: Install dependencies for honggfuzz
96 sudo apt-get -y install build-essential binutils-dev libunwind-dev
97 - name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
98 run: cd fuzz && cargo test --verbose --color always
100 run: cd fuzz && ./ci-fuzz.sh