language: c
sudo: false
addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test

install:
  - bash -x devtools/travis-ci/install.sh
  - export PYTHONUNBUFFERED=true
  - export PATH=$HOME/miniconda/bin:$PATH

script:
  # Create a test environment
  - conda create --yes -n test python=$python
  # Activate the test environment
  - source activate test
  # Add org channel
  - conda config --add channels ${ORGNAME}
  # Add omnia dev channels
  - conda config --add channels https://conda.anaconda.org/omnia/label/dev
  # Build the recipe
  - conda build devtools/conda-recipe
  # Install the package
  - conda install --yes --use-local ${PACKAGENAME}-dev
  # Install testing dependencies
  - conda install --yes --quiet nose nose-timer
  # Test the package
  - cd devtools && nosetests $PACKAGENAME --nocapture --verbosity=2 --with-timer --with-doctest -a '!slow' && cd ..

env:
  matrix:
    - python=2.7  CONDA_PY=27
    - python=3.5  CONDA_PY=35
    - python=3.6  CONDA_PY=36

  global:
    - ORGNAME="omnia" # the name of the organization
    - PACKAGENAME="pdbfixer" # the name of your package
    # encrypted BINSTAR_TOKEN for push of dev package to binstar
    - secure: "hhzbVwxc6bUUkvcU4SauCUSGUIwDHV5Mq7lNZkzhQOeOQOXBCoew3zl44qwLUUYbO+Hla/+U2UqxvXZ5vx4IJzvHcMJhXB6ZiNwc5hwZtvduWzmDJZ+ErASDsdvRCGXxDz90TkOxoL/Wy6lMr6OIMMosrjY6NJGotMiCB9IUDqY="

after_success:
  - echo "after_success"
  - if [ "$TRAVIS_SECURE_ENV_VARS" == true ]; then source devtools/travis-ci/after_success.sh; fi
