language: ruby

sudo: false

services: memcache

rvm:
  - 2.3.8
  - 2.4.5
  - 2.5.3
  - 2.6.0
  - ruby-head

matrix:
  allow_failures:
    - rvm: ruby-head

cache:
  bundler: true
  directories:
    - node_modules

# ignored --deployment option
bundler_args: "--without server --jobs=3 --retry=3"

before_install:
  - "echo 'gemspec' > Gemfile.local"
  - echo "gem 'phantomjs', '= 1.9.8.0'" >> Gemfile.local
  - gem update --system
  - gem update bundler
  - bundle update phantomjs

before_script:
  - npm install

script: if [ $TEST_MODE = "gem" ] ; then bundle exec tdiary test ; else bundle exec rake spec jasmine:ci test ; fi

env:
  - TEST_MODE=rack
  - TEST_MODE=gem

notifications:
  irc: "irc.freenode.org#tdiary"
