| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- dist: trusty
- language: python
- cache:
- directories:
- - $HOME/.cache/pip
- - $TRAVIS_BUILD_DIR/.tox
- os:
- - linux
- # - osx
- matrix:
- fast_finish: true
- allow_failures:
- - os: osx
- include:
- - python: 2.7
- env: TOX_ENV=py27-aws
- - python: 2.7
- env: TOX_ENV=py27-azure
- - python: 2.7
- env: TOX_ENV=py27-openstack
- - python: 3.6
- env: TOX_ENV=py36-aws
- - python: 3.6
- env: TOX_ENV=py36-azure
- - python: 3.6
- env: TOX_ENV=py36-openstack
- - python: pypy-5.3.1
- env: TOX_ENV=pypy-aws
- - python: pypy-5.3.1
- env: TOX_ENV=pypy-azure
- - python: pypy-5.3.1
- env: TOX_ENV=pypy-openstack
- env:
- global:
- - PYTHONUNBUFFERED=True
- before_install:
- - |
- case "$TRAVIS_EVENT_TYPE" in
- push|pull_request)
- # Check whether we need to run a test for this provider
- DOCS_REGEX='(\.rst$)|(^(docs))/'
- FILES_IN_CHANGESET="`git diff --name-only $TRAVIS_COMMIT_RANGE`"
- echo "$FILES_IN_CHANGESET" | grep -qvE "$DOCS_REGEX" || {
- echo "Only docs were updated. Stopping build process."
- exit
- }
- echo "$FILES_IN_CHANGESET" | grep -qvE "$DOCS_REGEX|(^(cloudbridge/cloud/providers))" || {
- echo "Only docs and providers were updated. Checking whether this provider was changed."
- # Extract env and provider from $TOXENV into $PYENV and $PROVIDER respectively
- IFS=- read PYENV PROVIDER <<< "$TOX_ENV"
- echo "$FILES_IN_CHANGESET" | grep -qE "^(cloudbridge/cloud/providers/$PROVIDER)" && {
- echo "This provider was affected by this changeset. Running tests."
- } || {
- echo "This provider was not affected by this changeset. Stopping build process."
- exit
- }
- }
- ;;
- *)
- echo "Build triggered through API or CRON job. Running regardless of changes"
- ;;
- esac
- install:
- - pip install -U pip
- - pip install -U setuptools
- - pip install tox
- - pip install coveralls
- - pip install codecov
- script:
- - tox -r -e $TOX_ENV
- after_script:
- - |
- case "$TRAVIS_EVENT_TYPE" in
- push|pull_request)
- # Don't run coverage if tests or cloudbridge interface was not affected
- DOCS_REGEX='(\.rst$)|(^(docs))/'
- FILES_IN_CHANGESET="`git diff --name-only $TRAVIS_COMMIT_RANGE`"
- echo "$FILES_IN_CHANGESET" | grep -qvE "$DOCS_REGEX|(^(cloudbridge/cloud/providers))" && {
- coveralls &
- codecov &
- wait
- } || {
- echo "Only docs and providers were updated. Not running coverage."
- }
- ;;
- *)
- echo "Build triggered through API or CRON job. Running regardless of changes"
- coveralls & codecov & wait
- ;;
- esac
|