# After changing this file, check it on:
#   http://lint.travis-ci.org/
language: python
sudo: false

matrix:
  include:
    #- os: linux
    #  python: 3.6
    #  env:
    #    - TOXENV=pylint
    #- os: linux
    #  python: 3.6
    #  env:
    #    - TOXENV=flake8
    #- os: linux
    #  python: 3.6
    #  env:
    #    - TOXENV=bandit
    #- os: linux
    #  python: 3.6
    #  env:
    #    - TOXENV=readme
    - os: linux
      python: 3.7
      env:
        - TOXENV=short
    - os: linux
      python: 3.8
      env:
        - TOXENV=short
    #- os: linux
    #  python: 3.9
    #  env:
    #    - TOXENV=short
    #    - BUILD_LINUX=yes
    #- os: osx
    #  osx_image: xcode9.3
    #  language: objective-c
    #  env:
    #    - TRAVIS_PYTHON_VERSION=3.6
    #    - TOXENV=short

cache: pip

before_install:
  - uname -a
  - df -h
  - ulimit -a
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source util/travis_osx_install.sh; fi
  - ccache -s
  - which python; python --version
  - pip install --upgrade pip
  - pip install --upgrade wheel
  # Set numpy version first, other packages link against it
  - pip install six nose coverage codecov pytest pytest-cov coveralls codacy-coverage parameterized secp256k1prp cryptography scrypt
  - pip install pycryptodomex  ruamel.yaml appdirs pylibscrypt tox asn1crypto diff_match_patch
  - pip install ecdsa requests websocket-client pytz six Click prettytable click_shell

script:
 - tox
 - sed -i 's/filename="/filename=".\//g' coverage.xml
 - ( which sonar-scanner && sonar-scanner || true )

after_success:
 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash util/package-osx.sh; fi
 - if [[ "$BUILD_LINUX" == "yes" ]]; then bash util/package-linux.sh; fi
 - coveralls
 - codecov 
  # - python-codacy-coverage -r coverage.xml

addons:
  sonarcloud:
    organization: holgern-github
