language: node_js
node_js:
  - "8"
dist: trusty   # needed for chrome headless
sudo: required # needed for chrome headless
addons:
  firefox: latest
  chrome: stable
  postgresql: "10"
  apt:
    packages:
    - postgresql-10
    - postgresql-client-10
    - postgresql-contrib-10
    # the following are mastodon dependencies
    - imagemagick
    - libpq-dev
    - libxml2-dev
    - libxslt1-dev
    - file
    - g++
    - libprotobuf-dev
    - protobuf-compiler
    - pkg-config nodejs
    - gcc
    - autoconf
    - bison
    - build-essential
    - libssl-dev
    - libyaml-dev
    - libreadline6-dev
    - zlib1g-dev
    - libncurses5-dev
    - libffi-dev
    - libgdbm3
    - libgdbm-dev
    - redis-tools
    - libidn11-dev
    - libicu-dev
services:
  - redis-server
before_install:
  - rvm install 2.5.0
  - rvm use 2.5.0
  - sudo -E add-apt-repository -y ppa:mc3man/trusty-media
  - sudo -E apt-get update
  - sudo -E apt-get install -y ffmpeg gstreamer0.10-ffmpeg
  - ruby --version
  - node --version
  - postgres --version
  - redis-server --version
  - ffmpeg -version
before_script:
  - npm run lint
script: npm run $COMMAND
env:
  global:
  - PGPORT=5433
  - secure: iR11lD+OAyTJdNoK67esDOrd34HKQboJo0DrVL4xqwoAwQGmNX7posBtcj0TOwVAdHfd5S80xlhWlMebrtHWR9oMtdcBXusWnehZVRB0WE89n8enkJCbAxn5uMpcEpKpDHTcfR/Gbxf2sw15dTy0PrW/ldiZXWf7wybJEBGbrEP7QI8oy3VHzmKpSyjRpN/hnSlgxskVnfIMKPp43D+705Ka7aMJNTWZ5dAdKdIjQWX6j6jlqx6Vl+qIq7td3DTZA9A5ft8HxaWC27F1bbd52PdRY2h8Ii3Ps+n8Q8uZK1KJPp9t3pPk+PmYINu2715ArukRk73kahnFadBQLhytn95FLiyKOLj+ajBNo+o3KIQDs3qRj8gkXpkJpuLAPgwABOEVWuLh9y+oa33IDYVzyESRVtXqbbwgziYVjNQCozP1Nt9+Wyh4YHfdOjEEMdlVlkwlyzPfaLAqVBusEphnaF/vx7itdVvxOMQYNcSRoBrAgciN4ng0GZHi5P85DMXnNV41r+d3JK5JEYZD/gpSja5cPUlpPlkXsKiElG3fEoO2D/Uc8rR9Cu84XiJiJQjP91QuWagfdhgqM4YOndt2YukiGzRzDMjTx1BzSW4S11RQGWzZrv06zmDLXTlnUAMEm1/Exo4L6VfgRvyFmgM0LAT+IceVEHbOKC/Hnd8Y3mo=
matrix:
  include:
    - env: BROWSER=chrome:headless COMMAND=test-browser
    - env: BROWSER=firefox:headless COMMAND=test-browser
    - env: COMMAND=deploy-dev-travis
  allow_failures:
    - env: BROWSER=firefox:headless COMMAND=test-browser
branches:
  only:
  - master
  - /^greenkeeper/.*$/
cache:
  directories:
  - $HOME/.npm
  - $HOME/.rvm
  - $HOME/.bundle
  - $HOME/.yarn-cache
