language: python
dist: trusty
python:
  - "2.7"
  - "3.3"
  - "3.4"
  - "3.5"
  - "3.6"
services:
  - docker
before_script:
  # @see https://medium.com/@mtparet/install-mysql-server-5-7-on-travis-96f2ebc0f339
  # @see https://hub.docker.com/_/mysql/
  - sudo docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d -p 3306:3306 mysql:5.7
  - sudo docker ps
  # set up a database
  - mysql -u root -e "CREATE DATABASE index_digest;"
  - mysql -u root -e "CREATE USER 'index_digest'@'localhost' IDENTIFIED BY 'qwerty';"
  - mysql -u root -e "GRANT ALL ON index_digest.* TO 'index_digest'@'localhost';"
  - "./sql/populate.sh" # import the test schema files
  - mysql -hlocalhost -uindex_digest -pqwerty index_digest -v -e '\s; SHOW TABLES;'

install: make install
script: make coverage && make lint && make demo

# @see https://github.com/nickstenning/travis-pip-cache/issues/1
cache: pip

language: python
dist: trusty
python:
  - "2.7"
  - "3.3"
  - "3.4"
  - "3.5"
  - "3.6"
services:
  - docker
before_script:
  # @see https://medium.com/@mtparet/install-mysql-server-5-7-on-travis-96f2ebc0f339
  # @see https://hub.docker.com/_/mysql/
  - sudo service mysql stop  # stop any running MySQL server
  - sudo docker run -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d -p 3306:3306 mysql:5.7
  - sudo docker ps
  # set up a database
  - mysql -u root -e "CREATE DATABASE index_digest;"
  - mysql -u root -e "CREATE USER 'index_digest'@'localhost' IDENTIFIED BY 'qwerty';"
  - mysql -u root -e "GRANT ALL ON index_digest.* TO 'index_digest'@'localhost';"
  - "./sql/populate.sh" # import the test schema files
  - mysql -hlocalhost -uindex_digest -pqwerty index_digest -v -e '\s; SHOW TABLES;'

install: make install
script: make coverage && make lint && make demo

# @see https://github.com/nickstenning/travis-pip-cache/issues/1
cache: pip

Stop the current MySQL server instance
Stop the current MySQL server instance
