.travis.yml 2.63 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
Carsten Brandt committed
23
  - mongodb
24

25
# faster builds on new travis setup not using sudo
26 27
# Disabled for install and use latest elasticsearch version
# 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"

40 41 42 43
before_install:
  - wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.4.deb && sudo dpkg -i --force-confnew elasticsearch-1.3.4.deb
  - sudo service elasticsearch start

Carsten Brandt committed
44
install:
45
  - composer self-update && composer --version
Qiang Xue committed
46
  - composer global require "fxp/composer-asset-plugin:1.0.0-beta3"
47
  - export PATH="$HOME/.composer/vendor/bin:$PATH"
48
# core framework:
49
  - composer install --prefer-dist
Carsten Brandt committed
50
  - tests/unit/data/travis/mongodb-setup.sh
51 52
  - tests/unit/data/travis/apc-setup.sh
  - tests/unit/data/travis/memcache-setup.sh
53
  - tests/unit/data/travis/cubrid-setup.sh
54
# codeception
55
  - composer global require "codeception/codeception=2.0.*" "codeception/specify=*" "codeception/verify=*"
Carsten Brandt committed
56
# basic and advanced application:
Qiang Xue committed
57
  - tests/unit/data/travis/setup-apps.sh
DaSourcerer committed
58

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

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

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