language: rust

rust:
  # check it compiles on the latest stable compiler
  - stable

before_install:
  |
    sudo apt-get update -qq &&
    sudo apt-get install -yqq vsftpd &&
    sudo useradd -s /bin/bash -d /home/ftp -m -c "Doe ftp user" -g ftp Doe &&
    echo "Doe:mumble" | sudo chpasswd &&
    echo "listen=yes
      anon_root=/home/ftp
      local_enable=yes
      local_umask=022
      pasv_enable=yes
      pasv_min_port=65000
      pasv_max_port=65010
      write_enable=yes
      log_ftp_protocol=yes" | sed -e "s/\s\+\(.*\)/\1/" | sudo tee /etc/vsftpd.conf &&
    sudo service vsftpd restart &&
    pip install "travis-cargo<0.2" --user &&
    export PATH=$HOME/.local/bin:$PATH

script:
  |
    travis-cargo build &&
    travis-cargo test -- --features secure &&
    travis-cargo --only stable doc &&
    rustup component add rustfmt &&
    cargo fmt --all -- --check

after_success:
  # upload the documentation from the build with stable (automatically only actually
  # runs on the master branch, not individual PRs)
  - travis-cargo --only stable doc-upload

env:
  global:
    secure: E/K+u8fhwLNKDvjG6kiuDumrXY/RMZOMa7SS88qhsPKStdHjNmaCwUFUe76RJDzMCqeN31u2mUwvMfMK3xDShABQjoD/tze/KbV5v6VTeL4vplHwZh6TzwaYKKBtNxL1q47A8FSTNK9PUbT+gEIAEY9Nadho7wKrYfT+CQxcb2A=
