-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
42 lines (42 loc) · 1.93 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Run Docker containers for database services to avoid unnecessary complication when trying to use
# latest stable versions of each engine. Travis CI and/or its underlying infrastructure provider
# (currently AWS) doesn't support latest stable versions of most database engines.
# https://docs.travis-ci.com/user/docker/
language: python
python:
- "3.6"
addons:
apt:
sources:
# https://docs.travis-ci.com/user/database-setup/#MySQL-5.7
- mysql-5.7-trusty
packages:
# Update Docker engine.
# https://docs.travis-ci.com/user/docker/#Installing-a-newer-Docker-version
- docker-ce
- mysql-client
- postgresql-client
services:
# I'm not sure what point the "services" key serves if MySQL, PostgreSQL, and Docker are already
# installed and active by default. Just going to roll with it.
- docker
# Warning: sudo and/or the Docker service cause job to run in virtual machine instead of container.
# https://docs.travis-ci.com/user/reference/overview/
sudo: true
before_install:
# Latest docker-compose is a dev dependency and is installed from PyPI in the install phase.
- sudo rm /usr/local/bin/docker-compose
install:
# The Makefile recipe to install dependencies installs them non-globally. Travis CI requires
# global: "User site-packages are not visible in this virtualenv."
- pip install -e ./src[dev]
before_script:
# Apparently, Travis CI starts database services by default. This interferes with port binding.
# MySQL, however, will already be stopped. The explicit MySQL APT source prevents default
# version from starting and the latest mysql-server package was not installed.
- sudo service postgresql stop
- docker-compose up -d
- while ! mysqladmin ping --host=127.0.0.1 --port=3306 --silent; do sleep 1; done
- while ! pg_isready -q -h 127.0.0.1 -p 5432 -t 5; do sleep 1; done
script:
- make tests