<commit_before>language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - hhvm
  - hhvm-nightly

# run build against hhvm but allow them to fail
# http://docs.travis-ci.com/user/build-configuration/#Rows-That-are-Allowed-To-Fail
matrix:
  fast_finish: true
  allow_failures:
    - php: hhvm
    - php: hhvm-nightly

services:
  - redis-server
  - memcached
  - elasticsearch
  - mongodb

# try running against postgres 9.3
addons:
  postgresql: "9.3"

install:
  - composer self-update && composer --version
  - export PATH="$HOME/.composer/vendor/bin:$PATH"
# core framework:
  - composer install --prefer-dist
  - tests/unit/data/travis/mongodb-setup.sh
  - tests/unit/data/travis/apc-setup.sh
  - tests/unit/data/travis/memcache-setup.sh
  - tests/unit/data/travis/cubrid-setup.sh
# codeception
  - composer global require "codeception/codeception=2.0.*"
  - composer global require "codeception/specify=*"
  - composer global require "codeception/verify=*"
# basic and advanced application:
  - tests/unit/data/travis/setup-apps.sh

before_script:
  - echo 'elasticsearch version ' && curl http://localhost:9200/
  - mysql -e 'CREATE DATABASE yiitest;';
  - psql -U postgres -c 'CREATE DATABASE yiitest;';
  - tests/unit/data/travis/sphinx-setup.sh
  - mongo yii2test --eval 'db.addUser("travis", "test");'
# basic and advanced application:
  - tests/unit/data/travis/init-apps.sh

script:
  - vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --exclude-group mssql,oci,wincache,xcache,zenddata
  - |
    if (php --version | grep -i HipHop > /dev/null); then
      echo "skipping application tests on HHVM"
    else
      cd apps/basic/web
      php -S localhost:8080 > /dev/null 2>&1 &
      PHP_PID=$!
      cd ../tests
      codecept run
      BASIC_EXIT=$?
      kill -9 $PHP_PID
      cd ../../advanced
      php -S localhost:8080 > /dev/null 2>&1 &
      PHP_PID=$!
      cd tests
      codecept run
      ADVANCED_EXIT=$?
      kill -9 $PHP_PID
      exit $BASIC_EXIT && $ADVANCED_EXIT
    fi

after_script:
  - cd ../../..
  - wget https://scrutinizer-ci.com/ocular.phar<commit_msg>Separated travis scripts for basic and advanced apps<commit_after>language: php

php:
  - 5.4
  - 5.5
  - 5.6
  - hhvm
  - hhvm-nightly

# run build against hhvm but allow them to fail
# http://docs.travis-ci.com/user/build-configuration/#Rows-That-are-Allowed-To-Fail
matrix:
  fast_finish: true
  allow_failures:
    - php: hhvm
    - php: hhvm-nightly

services:
  - redis-server
  - memcached
  - elasticsearch
  - mongodb

# try running against postgres 9.3
addons:
  postgresql: "9.3"

install:
  - composer self-update && composer --version
  - export PATH="$HOME/.composer/vendor/bin:$PATH"
# core framework:
  - composer install --prefer-dist
  - tests/unit/data/travis/mongodb-setup.sh
  - tests/unit/data/travis/apc-setup.sh
  - tests/unit/data/travis/memcache-setup.sh
  - tests/unit/data/travis/cubrid-setup.sh
# codeception
  - composer global require "codeception/codeception=2.0.*"
  - composer global require "codeception/specify=*"
  - composer global require "codeception/verify=*"
# basic and advanced application:
  - tests/unit/data/travis/setup-apps.sh

before_script:
  - echo 'elasticsearch version ' && curl http://localhost:9200/
  - mysql -e 'CREATE DATABASE yiitest;';
  - psql -U postgres -c 'CREATE DATABASE yiitest;';
  - tests/unit/data/travis/sphinx-setup.sh
  - mongo yii2test --eval 'db.addUser("travis", "test");'
# basic and advanced application:
  - tests/unit/data/travis/init-apps.sh

script:
  - vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --exclude-group mssql,oci,wincache,xcache,zenddata
  - |
    if (php --version | grep -i HipHop > /dev/null); then
      echo "Skipping basic application tests on HHVM"
    else
      cd apps/basic/web
      php -S localhost:8080 > /dev/null 2>&1 &
      PHP_PID=$!
      cd ../tests
      codecept run
      BASIC_EXIT=$?
      kill -9 $PHP_PID
      exit $BASIC_EXIT
    fi
  - |
    if (php --version | grep -i HipHop > /dev/null); then
      echo "Skipping advanced application tests on HHVM"
    else
      cd ../../advanced
      php -S localhost:8080 > /dev/null 2>&1 &
      PHP_PID=$!
      cd tests
      codecept run
      ADVANCED_EXIT=$?
      kill -9 $PHP_PID
      exit $ADVANCED_EXIT
    fi

after_script:
  - cd ../../..
  - wget https://scrutinizer-ci.com/ocular.phar
{'fraction_non_alphanumeric': 0.13327247832040165, 'fraction_numerical': 0.014148790506617983, 'mean_word_length': 2.6343283582089554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6661765', 'n_tokens_mistral': 1659, 'n_tokens_neox': 1597, 'n_words': 351}