forked from Codeception/Codeception
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
122 lines (112 loc) · 6.43 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
language: php
php:
- 5.4
- 5.5
- 5.6
- hhvm
matrix:
allow_failures:
- php: hhvm
branches:
except:
- gh-pages
cache:
directories:
- vendor
- $HOME/.composer/cache
services:
- mongodb
- rabbitmq
sudo: false
cache:
directories:
- vendor
- $HOME/.composer/cache
install:
# use hhvm-serve instead of builtin server
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || mkdir -p /home/travis/go/{src,bin,pkg}'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || export GOPATH="/home/travis/go"'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || export PATH="$GOPATH/bin:$PATH"'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || go get github.com/Naktibalda/hhvm-serve'
- wget http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
- composer global require "fxp/composer-asset-plugin:1.0.0"
- composer self-update
- 'if [ "$TRAVIS_PHP_VERSION" = "5.4" ]; then composer require guzzlehttp/guzzle=~5.0; fi' # install old guzzle
- composer install --prefer-source
# Yii2
- composer create-project yiisoft/yii2-app-basic frameworks-yii-basic
# Phalcon
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || git clone -q --depth=1 https://github.com/phalcon/cphalcon.git -b phalcon-v2.0.6'
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || (cd cphalcon/ext; export CFLAGS="-g3 -O1 -fno-delete-null-pointer-checks -Wall"; phpize &> /dev/null && ./configure --silent --enable-phalcon &> /dev/null && make --silent -j4 > /dev/null && make --silent install && phpenv config-add ../unit-tests/ci/phalcon.ini &> /dev/null && cd ../..;)'
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || (git clone -q --depth=1 https://github.com/phalcon/forum.git frameworks-phalcon; cp frameworks-phalcon/tests/config/config.php.dist frameworks-phalcon/app/config/config.php)'
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || composer install -d frameworks-phalcon --no-dev --prefer-source'
# Laravel 4
- git clone -q -b codeception-2.1 https://github.com/Codeception/sample-l4-app.git frameworks-laravel
- composer install -d frameworks-laravel --no-dev --prefer-source
# Laravel 5
- '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || git clone -q -b codeception-2.1 https://github.com/janhenkgerritsen/codeception-laravel5-sample.git frameworks-l5'
- '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || composer install -d frameworks-l5 --no-dev --prefer-dist'
# Symfony
- git clone -q -b symfony-old-demo https://github.com/Codeception/symfony-demo.git frameworks-symfony
- composer install -d frameworks-symfony --no-dev --prefer-source
# ZF1
- git clone -q -b 2.1 --recursive https://github.com/Naktibalda/codeception-zf1-tests frameworks-zf1
- composer install -d frameworks-zf1 --no-dev --prefer-source
# ZF2
- git clone -q -b 2.1 --recursive https://github.com/Naktibalda/codeception-zf2-tests frameworks-zf2
- composer install -d frameworks-zf2 --no-dev --prefer-source
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini'
- java -jar selenium-server-standalone-2.42.2.jar -port 4444 >/dev/null 2>&1 &
# create config file for hhvm
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "pid = /tmp/hhvm.pid" >>/tmp/hhvm.ini'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.server.port = 9000" >>/tmp/hhvm.ini'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.server.type = fastcgi" >>/tmp/hhvm.ini'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.server.default_document = index.php" >>/tmp/hhvm.ini'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.log.use_log_file = true" >>/tmp/hhvm.ini'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.log.file = /tmp/hhvm-error.log" >>/tmp/hhvm.ini'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || echo "hhvm.repo.central.path = /tmp/hhvm.hhbc" >>/tmp/hhvm.ini'
# start hhvm
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || hhvm --config "/tmp/hhvm.ini" --mode daemon'
- sleep 5
# preparing databases
- "mysql -e 'create database codeception_test;'"
- psql -c 'create database codeception_test;' -U postgres
# starting demo servers
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php -S 127.0.0.1:8000 -t tests/data/app >/dev/null 2>&1 &'
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php -S 127.0.0.1:8010 -t tests/data >/dev/null 2>&1 &'
# use hhvm-serve instead of builtin server
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || hhvm-serve --document-root=tests/data/app --listen=127.0.0.1:8000 >/dev/null 2>&1 &'
- '[[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] || hhvm-serve --document-root=tests/data --listen=127.0.0.1:8010 >/dev/null 2>&1 &'
# Phalcon
- mysql -e 'CREATE DATABASE phosphorum CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;'
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || cat frameworks-phalcon/schemas/forum.sql | mysql phosphorum'
# Laravel 4
- touch frameworks-laravel/app/database/database.sqlite
- php frameworks-laravel/artisan migrate --seed -n --force
# Laravel 5
- '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || touch frameworks-l5/storage/testing.sqlite'
- '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || php frameworks-l5/artisan migrate --database=sqlite_testing --force'
# Symfony
- php frameworks-symfony/app/console doctrine:schema:create -n --env test
- php frameworks-symfony/app/console doctrine:fixtures:load -n --env test
# Build
- php codecept build -c frameworks-yii-basic/tests
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php codecept build -c frameworks-phalcon'
- php codecept build -c frameworks-laravel
- php codecept build -c frameworks-symfony
- '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || php codecept build -c frameworks-l5'
- php codecept build -c frameworks-zf1
- php codecept build -c frameworks-zf2
script:
- php codecept run cli,unit,web # self tests
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php codecept run coverage' # run coverage tests on php only
- php codecept run functional -c frameworks-yii-basic/tests # Yii2 tests
- php codecept run -c frameworks-laravel functional,api,unit # Laravel4 Tests
- '[[ "$TRAVIS_PHP_VERSION" == "5.4" ]] || php codecept run -c frameworks-l5' # Laravel5 Tests
- '[[ "$TRAVIS_PHP_VERSION" == "hhvm" ]] || php codecept run functional -c frameworks-phalcon' # Phalcon Tests
- php codecept run functional -c frameworks-symfony # Symfony Tests
- php codecept run functional -c frameworks-zf1 # ZF1 Tests
- php codecept run functional -c frameworks-zf2 # ZF2 Tests