sudo: required
language: python
python:
  - "3.5"

services:
  - mongodb

cache:
  apt: true
  pip: true
  directories:
    - bin/jasmine/node_modules

apt:
  sources:
    - google-chrome
  packages:
    - google-chrome-stable

install:
  - pip install -r config/requirements/local.txt
  - pip install coveralls

before_script:
  - export CHROME_BIN=chromium-browser
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start
  - sleep 3 # give xvfb some time to start

before_install:
  - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16

services:
  - mongodb
# command to run tests
script:
  - coverage run --source=apps manage.py test --pattern="test_*.py"
  - cd bin/jasmine && npm install && karma start ./tests/karma.conf.js --single-run
after_success:
  - coveralls
  - bash <(curl -s https://codecov.io/bash)
