sudo: required
dist: trusty

addons:
  apt:
    packages:
      - libssl-dev

language: rust
rust:
  - stable

# Need to cache the whole `.cargo` directory to keep .crates.toml for
# cargo-update to work
cache:
  directories:
    - /home/travis/.cargo
# But don't cache the cargo registry
before_cache:
  - rm -rf /home/travis/.cargo/registry

#git:
#  submodules: false
#before_install:
#  - sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
#  - git submodule update --init --recursive

install:
  - cargo test --no-run --color always --all --all-features

script:
  - RUST_BACKTRACE=full cargo test --color always --all
  - RUST_BACKTRACE=full cargo test --color always --all --all-features

#before_deploy:
#  - CARGO_TARGET_DIR=$HOME/cargo-target cargo doc --color always

after_success:
# Temporarily disabled because cargo tarpaulin does not set CARGO_MANIFEST_DIR.
#
# - bash <(curl https://raw.githubusercontent.com/xd009642/tarpaulin/master/travis-install.sh)
# - |
#   cargo tarpaulin --all --ignore-tests --out Xml &&
#   bash <(curl -s https://codecov.io/bash)
# - '[ $TRAVIS_PULL_REQUEST = false ] &&
#      [ "$TRAVIS_BRANCH" == "master" ] &&
#     ./.travis/docs.sh'
#deploy:
#  local_dir: $HOME/cargo-target/doc
#  repo: kdy1/rustdoc
#  target_branch: gh-pages
#  provider: pages
#  skip_cleanup: true
#  github_token: $GH_TOKEN
#  email: kdy1997.dev@gmail.com
#  name: "강동윤"
#  on:
#    branch: master

notifications:
  email: never
#  slack:
#    secure: rJ4xuH2auOcENKwxAM+0K08IufQ5HY5nFxTHAnSW82bQQfnP9D2mwo1782b2Jo05rt72FzbRBBEqqhC2vU5Mzs8btdtcl4CsEZLEZ5JGcV8G/Xq4Wkug6xk65LvzrfW6v9ZNdsdXc41KCbbalCDouJR3KkQ3RDQBQviG1nQzI0GsyuraMqTH7aKwZh4S4U/PRAalriW3eMoLw3al4mn3X4S60mAmmLs9bO4glUwMXsc68630ItEt+u2lPGXFj3LaWFkmD9nMSWCbAfAibZWThtqZogSxOEEsE+nW//HTXzICsic5s50JsIvwCXPqpAWDALGJhSTt+gSsrGFtCVhRJ1VOCcG/Y1ttGtsii3eeJ9yGgGt5F4ywbofQH9Decc5MWnKLiWDKPkTLDUV573fexvc4kgHYk0JtSz3q/5jVe6FwCwg1YNKcKW9A28sIoBxvgt5FOWwrwDhl7Ha0HX9gV0ylE88uaR/5OPzl5kXrjlaR3eua5EqaJ1lkezZvyRffJJJA07BxoF0eI5cQnR8jrw5PmybJpJWHXN48gd2CmGj3YB+JwiLpRAlWtkyKhM62UnQihN2h7mHcvwygGG8AGTk9mdWBkUYXxahZ+PPQHb4Mip/QXWdfK0DTAd52CLsYjW+Wc0xxW6jwEff3GaDaRDxU6IjWBmEo74XCRPqUiPk=

env:
  global:
    - CARGO_INCREMENTAL=0

branches:
  only:
    # This is where pull requests from "bors r+" are built.
    - staging
    # This is where pull requests from "bors try" are built.
    - trying
    # This is required to update docs.
    - master