Skip to content

Commit

Permalink
Use cargo-travis instead of travis-cargo
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Apr 30, 2018
1 parent 8cf18cc commit c24ec75
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
46 changes: 36 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
language: rust
sudo: false
# necessary for `travis-cargo coveralls --no-sudo`
sudo: required

cache: cargo

addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev
- cmake
sources:
- kalakris-cmake

rust:
- 1.17.0
- 1.18.0
Expand All @@ -20,19 +27,38 @@ rust:
- stable
- beta
- nightly
# load travis-cargo

before_script:
- export PATH=$HOME/.cargo/bin:$PATH
- export DISABLE_COVERALLS=0
- |
pip install 'travis-cargo<0.2' --user &&
export PATH=$HOME/.local/bin:$PATH
if [[ $TRAVIS_RUST_VERSION == 1.17.* || \
$TRAVIS_RUST_VERSION == 1.18.* || \
$TRAVIS_RUST_VERSION == 1.19.* ]]; then
export DISABLE_COVERALLS=1
echo "disable coveralls"
else
cargo install cargo-update || echo "cargo-update already installed"
cargo install cargo-travis || echo "cargo-travis already installed"
cargo install-update -a
fi
script:
- |
travis-cargo build &&
travis-cargo test &&
cargo run --example main
cargo build &&
cargo test &&
cargo doc -p pinyin --no-deps &&
cargo run --example main &&
cargo bench
after_success:
# measure code coverage and upload to coveralls.io
- travis-cargo coveralls --no-sudo
- |
if [[ $DISABLE_COVERALLS == 1* ]]; then
echo "disable coveralls"
else
cargo coveralls
fi
matrix:
allow_failures:
- rust: nightly
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
//! [![Build Status](https://img.shields.io/travis/mozillazg/rust-pinyin/master.svg)](https://travis-ci.org/mozillazg/rust-pinyin)
//! [![Coverage Status](https://img.shields.io/coveralls/mozillazg/rust-pinyin/master.svg)](https://coveralls.io/github/mozillazg/rust-pinyin)
//! [![Crates.io Version](https://img.shields.io/crates/v/pinyin.svg)](https://crates.io/crates/pinyin)
//! [![GitHub
//! stars](https://img.shields.io/github/stars/mozillazg/rust-pinyin.svg?style=social&label=Star)](https://github.com/mozillazg/rust-pinyin)
//! [![GitHub stars](https://img.shields.io/github/stars/mozillazg/rust-pinyin.svg?style=social&label=Star)](https://github.com/mozillazg/rust-pinyin)
//!
//! # Usage
//!
Expand Down

0 comments on commit c24ec75

Please sign in to comment.