Files
merkle.rs/.travis.yml
Andreas Fackler 205853656b Fix Clippy warnings in test code.
And use the same Rust nightly version for Clippy and Rustfmt.
2018-08-09 17:22:29 +02:00

82 lines
2.4 KiB
YAML

language: rust
cache:
directories:
- $HOME/.cargo
- $HOME/protobuf
- $TRAVIS_BUILD_DIR/target
rust:
- stable
- beta
matrix:
# Since this item is allowed to fail, don't wait for it's result to mark the
# build complete.
fast_finish: true
allow_failures:
- env: NAME='nightly'
- env: NAME='kcov'
include:
- env: NAME='nightly'
rust: nightly
- env:
- NAME='rustfmt'
- PROTOBUF_CODEGEN_VERSION=2.0.0
- PATH=$PATH:$HOME/.cargo/bin:$HOME/protobuf/bin
rust: nightly-2018-07-22
before_script:
- rustup component add rustfmt-preview
# Protoc plugin needed to generate proof.rs from proof.proto
- cargo install protobuf-codegen --version $PROTOBUF_CODEGEN_VERSION || echo "protobuf-codegen already installed"
# TODO: see if we can avoid installing protobuf-codegen and generating
# proof.rs in this build by using rustfmt options (see
# https://github.com/SpinResearch/merkle.rs/pull/38#issuecomment-391336829,
# paragraph 2).
- protoc --version
- protoc --rust_out src/proto/ protobuf/proof.proto
script:
- cargo fmt --all -- --check
- env: NAME='kcov'
sudo: required # travis-ci/travis-ci#9061
before_script:
- cargo install cargo-update || echo "cargo-update already installed"
- cargo install cargo-kcov || echo "cargo-kcov already installed"
- cargo install-update -a
script:
- cargo kcov --print-install-kcov-sh | sh
- cargo update # Creates `Cargo.lock` needed by next command
- cargo kcov --verbose --coveralls -- --verify --exclude-pattern=/.cargo,/usr/lib,src/proto
addons:
apt:
packages:
- libcurl4-openssl-dev
- libdw-dev
- binutils-dev
- libiberty-dev
- zlib1g-dev
- env: NAME='clippy'
rust: nightly-2018-07-22
before_script:
- rustup component add clippy-preview
script:
- cargo clippy --all --tests --all-features -- -D clippy
env:
global:
- RUSTFLAGS="-C link-dead-code"
script:
- cargo update
- cargo build --verbose --all-features
- cargo test --verbose --all-features
- cargo doc --verbose --all-features --no-deps
before_install:
- export PATH=$PATH:$HOME/protobuf/bin
- export PROTOC_VERSION=$(cat PROTOC_VERSION)
- bash install_protobuf.sh