# Travis configuration file using the build matrix feature
# Read more under http://docs.travis-ci.com/user/build-configuration/
# THIS SCRIPT IS SUPPOSED TO BE AN EXAMPLE. MODIFY IT ACCORDING TO YOUR NEEDS!

sudo: false
language: python
virtualenv:
  system_site_packages: false
matrix:
  fast_finish: true
  include:
    - python: 3.8
      env: DISTRIB="ubuntu" TOX_PYTHON_VERSION="py38" COVERAGE="true"
    - env: DISTRIB="conda" PYTHON_VERSION="3.8" COVERAGE="false"
install:
  - source tests/travis_install.sh
  - pip install -r requirements.txt
  # ^  DEPRECATION WARNING:
  # The automatic creation of a `requirements.txt` file is deprecated.
  # See `Dependency Management` in the docs for other options.
before_script:
  - git config --global user.email "roberto@dealmeida.net"
  - git config --global user.name "Beto Dealmeida"
script:
  - python setup.py develop
  - tox
  - |
    if [[ "$COVERAGE" == "true" ]]; then
      pre-commit install
      pre-commit run --all-files
    fi
after_success:
  - if [[ "$COVERAGE" == "true" ]]; then coveralls || echo "failed"; fi
  - if [[ "$COVERAGE" == "true" ]]; then codecov || echo "failed"; fi
after_script:
  - travis-cleanup
cache:
  pip: true
  directories:
    - $HOME/miniconda
