renemarc/countdoom

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
# -*-mode:yml-*- vim:ft=yaml

# Config file for automatic testing at Travis-CI.com
#
# Once tests are performed sucessfully, a coverage report is sent out to
# CodeClimate.com and a completion signal is sent to CodeCov.io.
# See https://docs.codeclimate.com/docs/travis-ci-test-coverage

# Setup environment for Python builds.
dist: xenial
language: python
python:
  - "3.8"
  - "3.7"
  - "3.6"
  - "3.5"
  # Disabled until typed_ast (used by pylint) is fixed.
  # See https://github.com/python/typed_ast/issues/134
  # - "pypy3"

# Declare required variables for Code Climate
env:
  global:
    - GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)
    - CC_TEST_REPORTER_ID=eb5a902253f7a3dfa19e6c4507825f5911142de119b037a27d276510845ed588

# Download Code Climate test reporter.
before_install:
  - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  - chmod +x ./cc-test-reporter

# Warn Code Climate that a test is about to run.
before_script:
  - ./cc-test-reporter before-build

# Install dependencies.
install:
  - pip install --upgrade tox-travis
  - pip install .[lint]
  - pip install .[test]

# Run tests.
script:
  - pylint ./countdoom/ ./tests/*.py
  - if [[ $TRAVIS_PYTHON_VERSION != '3.8' ]]; then (flake8 .); fi
  - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then (black --check --diff .); fi
  - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then (coverage run --source countdoom --module pytest; coverage xml); fi
  - tox

# Submit test results to Code Climate and CodeCov.
after_success:
  - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then ./cc-test-reporter format-coverage --input-type coverage.py; fi
  - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then ./cc-test-reporter upload-coverage; fi
  - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then codecov; fi

# Build Python wheel and submit it to PyPI when new tags are pushed.
#
# PyPI's token must be encrypted with Travis-CI CLi tool:
# $ echo -n YOUR_PASSWORD | travis encrypt --pro --debug -repo renemarc/countdoom
deploy:
 provider: pypi
 user: __token__
 password:
   secure: "Sy2Ol4iYXmC/1OycIS9+7aqXOxREM7QMO2Rs5iWojAAsKDf6U+0mSf/659GjMTJSgZqtxu3OHbYU/Daq+Rv5MXFbAa1bPKqScUqulvTAFtRG/7toKIxKy8TZbnJiODQ14XX8y3Ervwg6z5IohPjgpvdLIZqHt6kc24ad6lKrqUONCwUPDZ2wvOdhUbv7ZvNZu2dWeWFwowIDHXph3Enx+ozRmbpsCfXUWuCu9VeOVqgddza/3OXeDggwp4eqFNHQgFOQ8rKyId26W66lUDm5jgc+8qeIa50QSLQBQj4t77CzWG7HqiPb87T3BhJT9c8zUAbcfFA9YU3nX5qJMvYQaZMCkrwektvzGS2fUftL4AFNX3JnOIg/r3/rKrB0YQKp6ie6uzjErhbsVirOVpfCQvRM0ClQ4hA0nRw+iYm7InIr6izKfnuC5RekunIAAFC+79gt+mpt3H+4GjTe/irrLEYQlzbClD5Xy/uAXa6542i6zmsKNDoYkuMZ1o/UR2Yl9XP1UwH7xNPX6LI8GhhQuaQ3YiW8IpbJfieh0uPzTYsZ3UnDY78vOMJy3i7bMbE7t3NuxYVtqVdYLtQNg56S3BZzmHyyoJUM6K/vFClzJpDX9qVqCmOf5SgZgE3s0/qajxyt2r1mhN325m3XxMG5H4IXa/UT6ATJbcaTQRqnafA="
 distributions: sdist bdist_wheel
 on:
   tags: true
   branch: master
   repo: renemarc/countdoom
   python: "3.6"