.travis.yml 2.61 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
env:
11
  - CUBRID_VERSION=9.3.0/CUBRID-9.3.0.0206 CUBRID_PDO_VERSION=9.3.0.0001
12

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

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

26
# faster builds on new travis setup not using sudo
27
sudo: false
28 29 30 31

# cache vendor dirs
cache:
  directories:
Carsten Brandt committed
32
#    - cubrid # caching cubrid breaks the build on a regular basis and has nearly no speedup
33
    - vendor
34
    - $HOME/.composer/cache
35

36 37 38 39
# try running against postgres 9.3
addons:
  postgresql: "9.3"

Carsten Brandt committed
40
install:
41
  - travis_retry composer self-update && composer --version
Qiang Xue committed
42
  - travis_retry composer global require "fxp/composer-asset-plugin:1.0.0-beta4"
43
  - export PATH="$HOME/.composer/vendor/bin:$PATH"
44
# core framework:
45
  - travis_retry composer install --prefer-dist --no-interaction
Carsten Brandt committed
46
  - tests/unit/data/travis/mongodb-setup.sh
47 48
# TODO: APC currently fails composer. https://github.com/composer/composer/issues/3405
#  - tests/unit/data/travis/apc-setup.sh
49
  - tests/unit/data/travis/memcache-setup.sh
50
  - tests/unit/data/travis/cubrid-setup.sh
Carsten Brandt committed
51 52
# print elasticsearch version
  - curl http://localhost:9200
53
# codeception
54
  - travis_retry composer global require "codeception/codeception=2.0.*" "codeception/specify=*" "codeception/verify=*"
Carsten Brandt committed
55
# basic and advanced application:
Qiang Xue committed
56
  - tests/unit/data/travis/setup-apps.sh
DaSourcerer committed
57

Carsten Brandt committed
58
before_script:
59
  - echo 'elasticsearch version ' && curl http://localhost:9200/
Carsten Brandt committed
60 61
  - mysql -e 'CREATE DATABASE yiitest;';
  - psql -U postgres -c 'CREATE DATABASE yiitest;';
Carsten Brandt committed
62
  - tests/unit/data/travis/sphinx-setup.sh
63
  - mongo yii2test --eval 'db.addUser("travis", "test");'
Carsten Brandt committed
64
# basic and advanced application:
Qiang Xue committed
65
  - tests/unit/data/travis/init-apps.sh
Carsten Brandt committed
66

67
script:
68
  - vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --exclude-group mssql,oci,wincache,xcache,zenddata
69
  - |
70
    if (php --version | grep -i HipHop > /dev/null); then
71
      echo "Skipping basic application tests on HHVM"
72
    else
73 74 75 76
      cd apps/basic/web
      php -S localhost:8080 > /dev/null 2>&1 &
      cd ../tests
      codecept run
77 78 79 80 81
    fi
  - |
    if (php --version | grep -i HipHop > /dev/null); then
      echo "Skipping advanced application tests on HHVM"
    else
82
      cd apps/advanced
83 84 85
      php -S localhost:8080 > /dev/null 2>&1 &
      cd tests
      codecept run
86
    fi
87

88
after_script:
Qiang Xue committed
89
  - cd ../../..
90
  - travis_retry wget https://scrutinizer-ci.com/ocular.phar
91
  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover