.travis.yml 2.52 KB
Newer Older
Taufan Aditya committed
1 2 3 4 5
language: php

php:
  - 5.4
  - 5.5
6
  - 5.6
7
  - hhvm
8
  - hhvm-nightly
9 10 11 12

# run build against PHP 5.6 and hhvm but allow them to fail
# http://docs.travis-ci.com/user/build-configuration/#Rows-That-are-Allowed-To-Fail
matrix:
DaSourcerer committed
13
  fast_finish: true
14 15
  allow_failures:
    - php: 5.6
16 17
    - php: hhvm
    - php: hhvm-nightly
Taufan Aditya committed
18

19 20
services:
  - redis-server
21
  - memcached
22
  - elasticsearch
Carsten Brandt committed
23
  - mongodb
24

Carsten Brandt committed
25
install:
26
  - composer self-update && composer --version
27
# core framework:
28
  - composer install --prefer-dist
Carsten Brandt committed
29
  - tests/unit/data/travis/mongodb-setup.sh
30 31
  - tests/unit/data/travis/apc-setup.sh
  - tests/unit/data/travis/memcache-setup.sh
32
  - tests/unit/data/travis/cubrid-setup.sh
33 34
# basic application:
  - composer install --dev --prefer-dist -d apps/basic
35
  - cd apps/basic && composer require --dev codeception/codeception:1.8.*@dev codeception/specify:* codeception/verify:*
36
  - php vendor/bin/codecept build && cd ../..
37 38 39 40 41 42 43 44 45 46
# advanced application:
  - composer install --dev --prefer-dist -d apps/advanced
  - cd apps/advanced && composer require --dev codeception/codeception:1.8.*@dev codeception/specify:* codeception/verify:*
  - ./init --env=Development
  - sed -i s/root/travis/ common/config/main-local.php
  - cd backend && php ../vendor/bin/codecept build
  - cd ../common && php ../vendor/bin/codecept build
  - cd ../frontend && php ../vendor/bin/codecept build && cd ../../..
 # boot server
  - cd apps && php -S localhost:8080 > /dev/null 2>&1 &
DaSourcerer committed
47

Carsten Brandt committed
48
before_script:
49
  - echo 'elasticsearch version ' && curl http://localhost:9200/
Carsten Brandt committed
50 51
  - mysql -e 'CREATE DATABASE yiitest;';
  - psql -U postgres -c 'CREATE DATABASE yiitest;';
Carsten Brandt committed
52
  - tests/unit/data/travis/sphinx-setup.sh
53
  - mongo yii2test --eval 'db.addUser("travis", "test");'
54 55 56 57 58 59
  - mysql -e 'CREATE DATABASE yii2_advanced_acceptance;';
  - mysql -e 'CREATE DATABASE yii2_advanced_functional;';
  - mysql -e 'CREATE DATABASE yii2_advanced_unit;';
  - cd apps/advanced/frontend/tests/acceptance && php yii migrate --interactive=0
  - cd ../functional && php yii migrate --interactive=0
  - cd ../unit && php yii migrate --interactive=0 && cd ../../../../..
Carsten Brandt committed
60

61
script:
62
  - vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --exclude-group mssql,oci,wincache,xcache,zenddata
63
  - cd apps/basic && php vendor/bin/codecept run
64 65 66
  - cd ../advanced/backend && ../vendor/bin/codecept run
  - cd ../common && ../vendor/bin/codecept run
  - cd ../frontend && ../vendor/bin/codecept run
67

68
after_script:
Johnny Theill committed
69
  - cd ../../..
70 71
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover