language: go

python: 2.7

services:
  - mysql

before_install:
  - pip install --upgrade pip virtualenv
  - virtualenv "${HOME}/FSENV"
  - mysql --print-defaults

install:
  - source "${HOME}/FSENV/bin/activate" && pip install -e .
  - go get -v -t ./... # Install dependencies needed for tests.

before_script:
  - export MYSQL_TEST_USER=travis
  - export MYSQL_TEST_ADDR=127.0.0.1:3306

script:
  - source "${HOME}/FSENV/bin/activate"
  - fleetspeak/build.sh && fleetspeak/test.sh

matrix:
  include:
    - os: linux
      language: go
      python: 2.7
      services:
        - mysql
      env:
        - MYSQL_TEST_USER=travis
        - MYSQL_TEST_ADDR=127.0.0.1:3306
      before_install:
        - pip install --upgrade pip virtualenv
        - virtualenv "${HOME}/FSENV"
        - mysql --print-defaults
        - go get -u github.com/golang/lint/golint
      install:
        - source "${HOME}/FSENV/bin/activate" && pip install -e .
        - go get -v -t ./... # Install dependencies needed for tests.
      script:
        - golint ./...
        - go vet ./... || true
        - source "${HOME}/FSENV/bin/activate"
        - fleetspeak/build.sh && fleetspeak/test.sh

    # Note that mysql is not available in OSX environments.
    - os: osx
      language: go
      python: 2.7
      before_install:
        - git clone https://github.com/MacPython/terryfy
        # Install pip.
        - >-
          source terryfy/travis_tools.sh &&
          get_python_environment macpython 2.7.14
        - pip install --upgrade pip virtualenv
        - virtualenv "${HOME}/FSENV"
        - go version
      install:
        - source "${HOME}/FSENV/bin/activate" && pip install -e .
        - go get -v -t ./... # Install dependencies needed for tests.
      script:
        - source "${HOME}/FSENV/bin/activate"
        - fleetspeak/build.sh && fleetspeak/test.sh

Add a MacOS Travis job.
Add a MacOS Travis job.