language: python

dist: xenial

addons:
    apt:
        packages:
            - libxkbcommon-x11-0  # for PyQt 5.12
            - libxcb-icccm4
            - libxcb-image0
            - libxcb-keysyms1
            - libxcb-randr0
            - libxcb-render-util0
            - libxcb-xinerama0

matrix:
  include:

    - python: '3.6'
      env: ORANGE="3.25.1"

    - python: '3.6'
      env: ORANGE="release"

    - python: '3.7'
      env: ORANGE="release"

    - python: '3.7'
      env: ORANGE="master"

cache:
    apt: true
    pip: true
    ccache: true
    directories:
        - $TRAVIS_BUILD_DIR/pyqt

before_install:
    - pip install -U pip wheel setuptools
    - pip install codecov

install:
    - pip install sip pyqt5==5.11.*
    - source $TRAVIS_BUILD_DIR/.travis/install_orange.sh
    - pip install .

    - mkdir -p $(python -c 'from Orange.misc.environ import cache_dir; print(cache_dir())')

script:
    - catchsegv xvfb-run -a -s "-screen 0 800x600x24" coverage run setup.py test

after_success:
    - codecov
