.travis.yml
dist: xenial # required for Python >= 3.7
env:
global:
- CC_TEST_REPORTER_ID=$CODE_CLIMATE_REPORTER_ID
language: python
if: 'type = pull_request OR branch = master'
python:
- "3.7"
- "3.8"
jobs:
include:
- os: osx
osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4
language: shell
python: "3.7"
before_script: echo "Not sending code coverage to code climate on OSx"
after_script: echo "Not sending code coverage to code climate on OSx"
- os: windows
language: sh
python: "3.7"
before_install:
- choco install python3 --params "/InstallDir:C:\\Python"
- export PATH="/c/Python:/c/Python/Scripts:$PATH"
- python -m pip install --upgrade pip wheel
before_script: echo "Not sending code coverage to code climate on Windows"
after_script: echo "Not sending code coverage to code climate on Windows"
install:
- pip3 install -r requirements.txt
- pip3 install -r requirements-dev.txt
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
- cd $TRAVIS_BUILD_DIR
- echo "Current directory is $(pwd)"
- coverage run --concurrency=multiprocessing -m pytest --doctest-modules
- coverage combine
- coverage report -m --include=./\*\* --omit=tests/\*\*,.venv/\*\* --fail-under=70
- coverage xml -i --include=./\*\* --omit=tests/\*\*,.venv/\*\*
after_script:
- if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_PYTHON_VERSION" == "3.7" ]]; then echo "Reporting coverage to Code Climate" && ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi