# Based on http://conda.pydata.org/docs/travis.html
language: minimal
sudo: false # use container based build

matrix:
  fast_finish: true
  include:
  - env: ENV=py36
  - env: ENV=py37

before_install:
  - wget http://repo.continuum.io/miniconda/Miniconda3-3.16.0-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 --set show_channel_urls true
  - conda update -q conda
  - conda info -a

install:
  - conda env create -n test_env --file ci/requirements-$ENV.yml;
  - source activate test_env
  - conda list
  - pip install --no-deps -e .

script:
  - which python
  - python --version
  - python -c "import eccodes"
  - if [[ "$ENV" == "docs" ]]; then
      sphinx-build -W -b html docs build/sphinx/html;
    elif [[ "$ENV" == *"-qc" ]]; then
      pytest -v --flakes --doctest-glob="*.rst" --cov=eccodes --cov=gribapi --cov-report term-missing --pep8 --mccabe $EXTRA_FLAGS;
    else
      pytest -v --cov=eccodes --cov=gribapi --cov-report term-missing $EXTRA_FLAGS;
    fi

after_success:
  - coveralls

# Based on http://conda.pydata.org/docs/travis.html
language: minimal
sudo: false # use container based build

matrix:
  fast_finish: true
  include:
    - env: ENV=py36
    - env: ENV=py37

before_install:
  - wget http://repo.continuum.io/miniconda/Miniconda3-3.16.0-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 --set show_channel_urls true
  - conda update -q conda
  - conda info -a

install:
  - conda env create -n test_env --file ci/requirements-$ENV.yml;
  - source activate test_env
  - conda list
  - pip install --no-deps -e .

script:
  - black --check .
  - which python
  - python --version
  - python -c "import eccodes"
  - if [[ "$ENV" == "docs" ]]; then
    sphinx-build -W -b html docs build/sphinx/html;
    elif [[ "$ENV" == *"-qc" ]]; then
    pytest -v --flakes --doctest-glob="*.rst" --cov=eccodes --cov=gribapi --cov-report term-missing --pep8 --mccabe $EXTRA_FLAGS;
    else
    pytest -v --cov=eccodes --cov=gribapi --cov-report term-missing $EXTRA_FLAGS;
    fi

after_success:
  - coveralls

Add CI check for autoformatted code
Add CI check for autoformatted code
