1sudo: false 2language: rust 3matrix: 4 fast_finish: true 5 include: 6 - rust: nightly 7 - rust: nightly 8 os: osx 9 - rust: beta 10 - rust: beta 11 os: osx 12 - rust: stable 13 - rust: stable 14 os: osx 15 allow_failures: 16 - rust: nightly 17 18before_cache: 19 # Travis can't cache files that are not readable by "others" 20 - chmod -R a+r $HOME/.cargo 21 22before_install: 23 # install kcov 24 - > 25 if [ ! -d "$HOME/.kcov/bin" ]; then 26 wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && 27 tar xzf master.tar.gz && mkdir kcov-master/build && cd kcov-master/build && 28 cmake -DCMAKE_INSTALL_PREFIX:PATH=$HOME/.kcov .. && make && make install && cd ../.. 29 fi 30 - export PATH=$HOME/.kcov/bin:$PATH 31 32script: 33 - cargo build 34 35cache: 36 cargo: true 37 apt: true 38 directories: 39 - target/debug/deps 40 - target/debug/build 41 42addons: 43 apt: 44 packages: 45 - libcurl4-openssl-dev 46 - libelf-dev 47 - libdw-dev 48 - binutils-dev 49 - libiberty-dev 50 51after_success: 52 - '[ $TRAVIS_RUST_VERSION = stable ] && 53 [ $TRAVIS_BRANCH = master ] && 54 [ $TRAVIS_PULL_REQUEST = false ] && 55 (ls target/debug && 56 RUSTFLAGS="-C link-dead-code" cargo test --no-run && 57 for file in target/debug/atty-*; do 58 if [[ "${file: -2}" != ".d" ]]; then 59 mkdir -p "target/cov/$(basename $file)"; 60 kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; 61 fi; 62 done && 63 kcov --coveralls-id=$COVERALLS_REPO_TOKEN --merge target/cov target/cov/* && 64 echo "covered") || true' 65 - '[ $TRAVIS_RUST_VERSION = stable ] && 66 [ $TRAVIS_BRANCH = master ] && 67 [ $TRAVIS_PULL_REQUEST = false ] 68 && cargo doc --no-deps && 69 echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d / -f 2`/index.html>" > target/doc/index.html && 70 pip install --user ghp-import && 71 /home/travis/.local/bin/ghp-import -n target/doc && 72 git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages && 73 echo "documented"'