name: Continuous Integration Checks
-on:
- push:
+on: [push, pull_request]
jobs:
build:
strategy:
matrix:
toolchain: [ stable,
- beta,
+ nightly,
# 1.22.0 is MSRV for rust-lightning in general:
1.22.0,
# 1.34.2 is Debian stable
include:
- toolchain: stable
build-net-tokio: true
- - toolchain: beta
+ - toolchain: nightly
build-net-tokio: true
+ run-mutagen: true
- toolchain: 1.39.0
build-net-tokio: true
coverage: true
profile: minimal
- name: Build on Rust ${{ matrix.toolchain }} with net-tokio
if: matrix.build-net-tokio
- run: RUSTFLAGS="-C link-dead-code" cargo build --verbose
+ run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always
- name: Build on Rust ${{ matrix.toolchain }}
if: "! matrix.build-net-tokio"
- run: RUSTFLAGS="-C link-dead-code" cargo build --verbose -p lightning
+ run: RUSTFLAGS="-C link-dead-code" cargo build --verbose --color always -p lightning
- name: Test on Rust ${{ matrix.toolchain }} with net-tokio
if: matrix.build-net-tokio
- run: RUSTFLAGS="-C link-dead-code" cargo test --verbose
+ run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
- name: Test on Rust ${{ matrix.toolchain }}
if: "! matrix.build-net-tokio"
- run: RUSTFLAGS="-C link-dead-code" cargo test --verbose -p lightning
+ run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always -p lightning
+ - name: Run mutagen tests on ${{ matrix.toolchain }}
+ if: matrix.run-mutagen
+ # Run mutagen on nightly with TheBlueMatt's fork which exits with non-0 status
+ # if any mutations resulted in anything except test failures to prevent regressions.
+ run: |
+ rm -rf mutagen && git clone https://github.com/TheBlueMatt/mutagen
+ cargo install --force --path mutagen/mutagen-runner
+ cd lightning
+ ~/.cargo/bin/cargo-mutagen --features mutation_testing
+ # Generate code cov information on Rust 1.39.0
- name: Install deps for kcov
if: matrix.coverage
run: |
run: |
sudo apt-get update
sudo apt-get -y install build-essential binutils-dev libunwind-dev
- - name: Fuzz test on Rust ${{ matrix.TOOLCHAIN }}
- run: cd fuzz && cargo test --verbose
- - name: Generate fuzz report
+ - name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
+ run: cd fuzz && cargo test --verbose --color always
+ - name: Run fuzzers
run: cd fuzz && ./ci-fuzz.sh