fvalverd/AutoApi

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
dist: xenial
language: python
python:
  - "2.7"
  - "3.6"
  - "3.7"
  - "3.8"
env:
  global:
    - MONGO_HOST=localhost
    - MONGO_PORT=27018
    - MONGO_PORT_AUTH=27019
    - MONGO_ADMIN=admin
    - MONGO_ADMIN_PASS=pass
  matrix:
    - MONGO_VERSION=3.6
    - MONGO_VERSION=4.0
    - MONGO_VERSION=4.2
# jobs:
#   include:
#     - name: "Python 3.7.4 on macOS"
#       os: osx
#       osx_image: xcode11.4
#       language: shell       # 'language: python' is an error on Travis CI macOS
#       addons:
#         homebrew:
#           taps: mongodb/brew
#       before_install:
#         - brew install mongodb-community
#     - name: "Python 3.8 on Windows"
#       os: windows
#       language: shell       # 'language: python' is an error on Travis CI Windows
#       before_install:
#         - choco install python --version 3.8.2
#       env: PATH=/c/Python38:/c/Python38/Scripts:$PATH
#     - name: "Python 3.7 on Windows"
#       os: windows
#       language: shell       # 'language: python' is an error on Travis CI Windows
#       before_install:
#         - choco install python --version 3.7.7
#       env: PATH=/c/Python37:/c/Python37/Scripts:$PATH
#     - name: "Python 3.6 on Windows"
#       os: windows
#       language: shell       # 'language: python' is an error on Travis CI Windows
#       before_install:
#         - choco install python --version 3.6.8
#       env: PATH=/c/Python36:/c/Python36/Scripts:$PATH
#     - name: "Python 2.7 on Windows"
#       os: windows
#       language: shell       # 'language: python' is an error on Travis CI Windows
#       before_install:
#         - choco install python2
#       env: PATH=/c/Python27:/c/Python27/Scripts:$PATH
#       before_script: # no root user for Windows https://github.com/docker-library/mongo/issues/291
#         - export MONGO_AUTH_DIR=$(mktemp -d)
#         - docker run --name temporary_mongodb -d -v $MONGO_AUTH_DIR:C:\db mongo:$MONGO_VERSION mongod --bind_ip_all --dbpath=C:\db
#         - docker exec mongo --eval "db.createUser({user:'$MONGO_ADMIN', pwd:'$MONGO_ADMIN_PASS', roles:[{role:'root', db:'admin'}]})"
#         - docker kill temporary_mongodb
#         - docker run -d -p $MONGO_PORT_AUTH:27017 -v $MONGO_AUTH_DIR:C:\db mongo:$MONGO_VERSION mongod --auth --bind_ip_all --dbpath=C:\db
services:
  - docker
install:
  - python -m pip install -U -r requirements-tools.txt
  - python -m pip install -r requirements.txt -r requirements-dev.txt
  - docker run -d -p $MONGO_PORT:27017 mongo:$MONGO_VERSION mongod --bind_ip_all
before_script:
  - docker run -d -p $MONGO_PORT_AUTH:27017 -e MONGO_INITDB_ROOT_USERNAME=$MONGO_ADMIN -e MONGO_INITDB_ROOT_PASSWORD=$MONGO_ADMIN_PASS mongo:$MONGO_VERSION mongod --auth --bind_ip_all
  - python -m auto_api update-admin --port $MONGO_PORT_AUTH
script:
  - python -m pytest -v
# after_script:
#   - test $TRAVIS_BRANCH = "master" && python -m pip install coveralls && coveralls