hubcaps 0.5.0

Rust interface for Github
Documentation
sudo: required

language: rust

# only build pushes to master
# prs are build separately
# https://docs.travis-ci.com/user/pull-requests/#how-pull-requests-are-built
branches:
  only:
  - master

matrix:
  fast_finish: true
  include:
  - rust: nightly
  - rust: beta
  - rust: stable
  allow_failures:
    # hyper is not compiling on nightly https://github.com/hyperium/hyper/issues/1688
    - rust: nightly

script:
- travis_wait cargo test
- cargo run --example rate_limit

# Cache `cargo install`ed tools, but don't cache the project's `target`
# directory (which ends up over-caching and filling all disk space!)
# https://levans.fr/rust_travis_cache.html
cache:
  directories:
    - /home/travis/.cargo

before_cache:
  # But don't cache the cargo registry
  - rm -rf /home/travis/.cargo/registry
  # Travis can't cache files that are not readable by "others"
  - chmod -R a+r $HOME/.cargo

addons:
  apt:
    packages:
    - libssl-dev

after_success:
  - '[ $TRAVIS_EVENT_TYPE != "cron" ] &&
    [ $TRAVIS_RUST_VERSION = stable ] &&
    [ $TRAVIS_BRANCH = master ] &&
    [ $TRAVIS_PULL_REQUEST = false ] &&
    (
    `RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install cargo-tarpaulin`
    cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID && echo "covered"
    ) || true'
  - '[ $TRAVIS_RUST_VERSION = stable ] &&
    [ $TRAVIS_BRANCH = master ] &&
    [ $TRAVIS_PULL_REQUEST = false ]
    && cargo doc --no-deps &&
    echo "<meta http-equiv=refresh content=0;url=`echo $TRAVIS_REPO_SLUG | cut -d / -f 2`/index.html>" > target/doc/index.html'

deploy:
  provider: pages
  skip-cleanup: true
  github-token: $GH_TOKEN
  local-dir: target/doc
  keep-history: false
  on:
    branch: master
    condition: $TRAVIS_RUST_VERSION = stable