language: php

php:
  - 5.3
  - 5.4
  - 5.5

env:
  - DB=mysql

notifications:
  irc:
    - "irc.freenode.net#typo3-cms"
  email:
    - typo3-team-core@lists.typo3.org

services:
  - memcached

before_script:
  - sudo apt-get install parallel
  - git clone --single-branch --branch master --depth 1 git://github.com/typo3-ci/TYPO3-Travis-Integration.git build-environment
  - source build-environment/install-helper.sh
  - if [[ "$TRAVIS_PHP_VERSION" == "5.3" ]]; then installPhpModule -y apc; fi
  - if [[ "$TRAVIS_PHP_VERSION" != "5.5" ]]; then installPhpModule igbinary; fi
  - installPhpModule -y memcache
  - installPhpModule redis
  - mkdir fileadmin uploads typo3temp
  - mv build-environment/typo3conf .
  - git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3CMS/Extensions/phpunit.git typo3conf/ext/phpunit/
  - >
    if [[ "$DB" == "mysql" ]]; then
    	mysql -e "DROP DATABASE IF EXISTS typo3_test;" -uroot
    	mysql -e "CREATE DATABASE IF NOT EXISTS typo3_test;" -uroot
    	php build-environment/dbimport/DatabaseImport.php
    	mysql -uroot typo3_test < build-environment/dbimport/cli_users.sql
    fi

script:
  - printf "UnitTests\nFunctionalTests\nLint" | parallel --gnu --keep-order 'echo "Running {}"; ./build-environment/execute{}.sh'
