Merge branch 'master' of github.com:rust-bitcoin/rust-lightning into use-workspaces
[rust-lightning] / .travis.yml
1 language: rust
2 rust:
3   - stable
4   - beta
5   - 1.22.0
6   - 1.34.2
7 cache: cargo
8
9 before_install:
10   - sudo apt-get -qq update
11   - sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc binutils-dev libiberty-dev
12
13 script:
14      # Build workspaces with Rust stable, beta, and 1.34.0
15      - if [ "$(rustup show | grep default | grep 1.22.0)" == "" ]; then RUSTFLAGS="-C link-dead-code" cargo build --verbose; fi
16      # Build lightning workspace with Rust 1.22.0
17      - if [ "$(rustup show | grep default | grep 1.22.0)" != "" ]; then RUSTFLAGS="-C link-dead-code" cargo build --verbose -p lightning; fi
18      - rm -f target/debug/lightning-* # Make sure we drop old test binaries
19      # Test workspaces for Rust stable, beta, and 1.34.2
20      - if [ "$(rustup show | grep default | grep 1.22.0)" == "" ]; then RUSTFLAGS="-C link-dead-code" cargo test --verbose; fi
21      # Test lightning workspace for 1.22.0
22      - if [ "$(rustup show | grep default | grep 1.22.0)" != "" ]; then RUSTFLAGS="-C link-dead-code" cargo test --verbose -p lightning; fi
23      # Run lightning workspace fuzz tests for Rust 1.34.2
24      - if [ "$(rustup show | grep default | grep 1.34.2)" != "" ]; then cd lightning/fuzz && cargo test --verbose && ./travis-fuzz.sh; fi
25      - if [ "$(rustup show | grep default | grep stable)" != "" ]; then
26            wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
27            tar xzf master.tar.gz &&
28            cd kcov-master &&
29            mkdir build &&
30            cd build &&
31            cmake .. &&
32            make &&
33            make install DESTDIR=../../kcov-build &&
34            cd ../.. &&
35            rm -rf kcov-master &&
36            for file in target/debug/lightning-*; do [ -x "${file}" ] || continue; mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done &&
37            bash <(curl -s https://codecov.io/bash) &&
38            echo "Uploaded code coverage"; fi