language: python
python:
  - 2.7

# Setup anaconda
before_install:
  - if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then wget http://repo.continuum.io/miniconda/Miniconda-3.8.3-Linux-x86_64.sh -O miniconda.sh; else wget http://repo.continuum.io/miniconda/Miniconda3-3.8.3-Linux-x86_64.sh -O miniconda.sh; fi
  - chmod +x miniconda.sh
  - ./miniconda.sh -b
  - export PATH=/home/travis/anaconda/bin:/home/travis/miniconda/bin:$PATH
  - conda update --yes conda
  # The next couple lines fix a crash with multiprocessing on Travis and are not specific to using Miniconda
  - sudo rm -rf /dev/shm
  - sudo ln -s /run/shm /dev/shm

# Install packages
install:
  - conda install --yes pip python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib cython
  - pip install nose-cov python-coveralls
  # Remove this when SimPEG is on pip
  - git clone https://github.com/simpeg/simpeg.git
  - cd simpeg/
  - python setup.py install
  - cd ../

# Run test
script:
  - nosetests --with-cov --cov simpegDC --cov-config .coveragerc

# Calculate coverage
after_success:
  - coveralls --config_file .coveragerc

notifications:
  email:
    - rowanc1@gmail.com
