machine:
  timezone: America/New_York
  ruby:
    version: 2.2.3
  hosts:
    ee2.test: 127.0.0.1
  environment:
    php_versions: 5.3.20 5.4.37 5.5.21 5.6.14 7.0.4

dependencies:
  override:
    - "cd tests/rspec && bundle install --without development --deployment"
    - "cd system/ee/EllisLab/Tests && composer install --prefer-source --no-interaction"
  post:
    - cp tests/circleci/circleci-apache /etc/apache2/sites-available
    - a2ensite circleci-apache
    - sudo service apache2 restart
  cache_directories:
    - "tests/rspec/vendor/bundle"
    - "system/ee/EllisLab/Tests/vendor"

checkout:
  post:
    - cp tests/circleci/config.php system/user/config/
    - cp tests/circleci/license.key system/user/config/
    - chmod 666 system/user/config/config.php
    - chmod -R 777 system/user
    - chmod -R 777 system/ee/legacy/translations
    - chmod 777 tests/rspec/support/tmp
    - mkdir -p tests/rspec/support/file-sync/uploads
    - chmod -R 777 tests/rspec/support/file-sync/uploads
    - chmod -R 777 images
    - chmod +x tests/circleci/runtests.sh

test:
  override:
    - "rvm use 2.2.3 && ./tests/circleci/runtests.sh":
        parallel: true
