language: rust
rust: stable
os: linux
dist: trusty
sudo: false
addons:
  apt:
    packages:
    - fakeroot
    - musl-tools

cache:
- apt
- cargo

before_cache:
- rm -r $TRAVIS_BUILD_DIR/target/debug

script:
- cargo build $CARGO_ARGS
- cargo test $CARGO_ARGS

jobs:
  include:
  - rust: stable
  - rust: beta
  - rust: nightly

  # deploy
  - stage: publish docs
    env:
    # GH_TOKEN
    -  secure: "g8UoQdG0w09xquGMDmnvkCO3b4/jb00OrFvXgCrN9g8m7RrX+ZQ98Ztjjp9Dr4Sni1U3V9LrTFrEFv9+vrNJJX6TQ2rLOZOF+IvlYLFOsz6LcNHTqcnAYJoTy+VqsXTwkNs3TP9LwUnxX0X0N8GxyKAJJ0wSHZvNooDDi8x2jeGuT5AwyRd3S9zoBi4nlQdwU20NErH0i50ayEKE1SLQJcG3Xtl6OtHGqxHWgOPXNQwqY/042NOnMFiL40lvh3iS2xtM2sDwRdfWj+pmvji2FRMHlkC+g5JwC50KkeCL+VBrT8MZbUW8UWjDC9J1tV7zfA8HY0nURgYl6g2NWe0/7vTgx0oQM+9Kf0OcNWVBA2j7g8MVJA9/1JW6B11a7oFgRDmJLGGrqaIAndrviho/V1OQtB4l0h1ZF6iUVZwuRHdCd6wxY4ahCQHjnsGUxnzYAgU2e/7IL/gKXjYhUdly99Ah018XXZ2MqAXISoh3fpKJg52pKcfjnJr3bDs6mpBHVdHH/zfk3jWtmvcozPubRSXsjnLFeBnAGdLz8pWHq9tzRTIQoV1RDNo4a73ck9diti52HhKfWFGojmrAXABWwkJ7wor0F3/uxHhbTpuHf+AFO8tgPyEamLFWL7WCbxFLXI7SSuewdCgEEV0Kz2Xrj0/prywHmaREUgblwyk8wpc="
    # CARGO_TOKEN
    - secure: "AatVkDxYdzu8K1Qa6xlwVbfXu1YfuxfKd+jZoCFzKq1tP3OLtAbWsoZsiyGcgfDk3gq3oXHFbgjXObM/N6wA4U94mvZMralHkWc7eoECrfGjPz0ei8EOXzgFlWtE3keKBMvrCzIOUNt6+y20NsFgxfv9tSLWN7gRRWl8T+RQ6aO5p5kuI7mmN+e5y7QdtIEODeqRnpBl4wbG/BltJG0YrBoxt/R42inIHw0gUYZzAk8Xypjczb9aGdSwZmXxMw78n9Km4e+Z5/enUxam+qr/Rf4vBoBDpq3l7GIgl6ZHBHWAcKb9r8Vj1OJdwN0Bf4q13LRJNYISLCya0XYUZl0A4/2TOGBkO+RpPON8OoYTZcGSJ8O/5z9tuViSKoogmJipm8KTPh/u3yi4qdkt2hSdkn8OEpvDV53CCm9lQVTglE14uQCnrUYefXtrp3JPSIYb+TTqJW13p5LV/vr/lHDXk2oqU1eSL3b+se1kOogsVQOS+WDo5lvhDN6PbkU7+iLeYkFe7wVcDfZV/nf4QV4ZfMpgtXHPdy+PbhITnOZKuGA52ZTqi+tDn3RxHY0sGZFXLRpVZB2o73jJAc6t/uWlrEUQw1T2CJA3ohxfFlrF8WTItCAYT/pIR7Rr4qxloLkvVcWB5L3WsudZyJpUNrl3ch67yydpzSzr4xiv2X6u0Bo="
    install: true

    deploy:
    - provider: script
      script: 'cargo publish --verbose --token=$CARGO_TOKEN'
      on:
        tags: true
