language: python

matrix:
  include:
    - python: 2.7
    - python: 3.6

before_install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
    wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
    bash miniconda.sh -b -p $HOME/miniconda;
    export PATH="$HOME/miniconda/bin:$PATH";
    hash -r;
    conda config --set always_yes yes --set changeps1 no;
    conda update -q conda;
    conda info -a;
    conda create -y -q -n compas_3x -c conda-forge python=3.6;
    source ~/miniconda/bin/activate compas_3x;
    pip install -r requirements-dev.txt;
  else
    sudo apt-get update -qq;
    pip install -r requirements-dev.txt;
  fi

install:
- python setup.py install;

script:
- invoke test
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
    cd temp && git clone https://github.com/compas-dev/sphinx_compas_theme && cd ..;
    invoke docs;
  fi

deploy:
  provider: pages
  skip_cleanup: true
  keep-history: true
  github_token: $GITHUB_TOKEN
  repo: compas-dev/main
  name: COMPAS doc bot
  target-branch: master
  local_dir: dist/docs
  on:
    branch: master
    condition: $TRAVIS_PYTHON_VERSION = 2.7

language: python

matrix:
  include:
    - python: 2.7
    - python: 3.6

before_install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
    wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
    bash miniconda.sh -b -p $HOME/miniconda;
    export PATH="$HOME/miniconda/bin:$PATH";
    hash -r;
    conda config --set always_yes yes --set changeps1 no;
    conda update -q conda;
    conda info -a;
    conda create -y -q -n compas_3x -c conda-forge python=3.6;
    source ~/miniconda/bin/activate compas_3x;
    pip install -r requirements-dev.txt;
  else
    sudo apt-get update -qq;
    pip install -r requirements-dev.txt;
  fi

install:
- python setup.py install;

script:
- invoke test
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
    cd temp && git clone https://github.com/compas-dev/sphinx_compas_theme && cd ..;
    invoke docs;
  fi

deploy:
  provider: pages
  skip_cleanup: true
  keep-history: true
  github_token: $GITHUB_TOKEN
  repo: compas-dev/main
  name: COMPAS doc bot
  target-branch: master
  local_dir: dist/docs
  on:
    branch: master
    condition: $TRAVIS_PYTHON_VERSION = 3.6

Switch to build docs with Python 3.6
Switch to build docs with Python 3.6