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

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

# 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
12
  fast_finish: true
13 14 15
  allow_failures:
    - php: hhvm
    - php: 5.6
Taufan Aditya committed
16

17 18
services:
  - redis-server
19
  - memcached
20
  - elasticsearch
Carsten Brandt committed
21
  - mongodb
22

Carsten Brandt committed
23
install:
24
  - composer self-update && composer --version
25
# core framework:
26
  - composer install --prefer-dist
Carsten Brandt committed
27
  - tests/unit/data/travis/mongodb-setup.sh
28 29
  - tests/unit/data/travis/apc-setup.sh
  - tests/unit/data/travis/memcache-setup.sh
30
  - tests/unit/data/travis/cubrid-setup.sh
31 32
# basic application:
  - composer install --dev --prefer-dist -d apps/basic
33
  - cd apps/basic && composer require --dev codeception/codeception:1.8.*@dev codeception/specify:* codeception/verify:*
34
  - php vendor/bin/codecept build && cd ../..
35 36 37 38 39 40 41 42 43 44
# 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
45

Carsten Brandt committed
46
before_script:
47
  - echo 'elasticsearch version ' && curl http://localhost:9200/
Carsten Brandt committed
48 49
  - mysql -e 'CREATE DATABASE yiitest;';
  - psql -U postgres -c 'CREATE DATABASE yiitest;';
Carsten Brandt committed
50
  - tests/unit/data/travis/sphinx-setup.sh
51
  - mongo yii2test --eval 'db.addUser("travis", "test");'
52 53 54 55 56 57
  - 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
58

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

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