language: rust

rust:
  - stable
  - beta
  - nightly

matrix:
  allow_failures:
    - rust: nightly

branches:
  except:
    - dev

os:
  - linux
  - osx

script:
  - cargo build --verbose
  - cargo test --verbose
  - cargo doc --no-deps

after_success: |
  [ $TRAVIS_BRANCH = master ] &&
  [ $TRAVIS_PULL_REQUEST = false ] &&
  [ $TRAVIS_RUST_VERSION = nightly ] &&
  echo '<meta http-equiv=refresh content=0;url=musicbrainz/index.html>' > target/doc/index.html &&
  pip install ghp-import --user $USER &&
  $HOME/.local/bin/ghp-import -n target/doc &&
  git push -qf https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages

notifications:
  email:
    on_success: never

language: rust

rust:
  - stable
  - nightly

matrix:
  allow_failures:
    - rust: nightly

branches:
  except:
    - dev

os:
  - linux
  - osx

before_install: |
  if [ "$TRAVIS_OS_NAME" == "osx" ]; then
    brew update &&
    brew install openssl &&
    export OPENSSL_INCLUDE_DIR="$(brew --prefix openssl)/include" &&
    export OPENSSL_LIB_DIR="$(brew --prefix openssl)/lib";
  fi


script:
  - cargo build --verbose
  - cargo test --verbose
  - cargo doc --no-deps

after_success: |
  [ $TRAVIS_OS_NAME = linux ] &&
  [ $TRAVIS_BRANCH = master ] &&
  [ $TRAVIS_PULL_REQUEST = false ] &&
  [ $TRAVIS_RUST_VERSION = nightly ] &&
  echo '<meta http-equiv=refresh content=0;url=musicbrainz/index.html>' > target/doc/index.html &&
  pip install ghp-import --user $USER &&
  $HOME/.local/bin/ghp-import -n target/doc &&
  git push -qf https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages

notifications:
  email:
    on_success: never

Fix build on OS X
Fix build on OS X
