.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
  - tests/unit/data/travis/apc-setup.sh
48
  - tests/unit/data/travis/memcache-setup.sh
49
  - tests/unit/data/travis/cubrid-setup.sh
50
# codeception
51
  - travis_retry composer global require "codeception/codeception=2.0.*" "codeception/specify=*" "codeception/verify=*"
Carsten Brandt committed
52
# basic and advanced application:
Qiang Xue committed
53
  - tests/unit/data/travis/setup-apps.sh
DaSourcerer committed
54

Carsten Brandt committed
55
before_script:
56
  # show some versions and env information
57
  - echo 'elasticsearch version ' && curl http://localhost:9200/
Carsten Brandt committed
58
  - php -r "echo INTL_ICU_VERSION . \"\n\";"
59 60 61 62
  - mysql --version
  - psql --version

  # initialize databases
Carsten Brandt committed
63 64
  - mysql -e 'CREATE DATABASE yiitest;';
  - psql -U postgres -c 'CREATE DATABASE yiitest;';
Carsten Brandt committed
65
  - tests/unit/data/travis/sphinx-setup.sh
66
  - mongo yii2test --eval 'db.addUser("travis", "test");'
Carsten Brandt committed
67
# basic and advanced application:
Qiang Xue committed
68
  - tests/unit/data/travis/init-apps.sh
Carsten Brandt committed
69

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

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