forked from directus/v8-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
73 lines (63 loc) · 2.73 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
language: php
services:
- mysql
branches:
except:
- build
php:
- 5.6
- 7.0
- 7.2
# - hhvm
# matrix:
# allow_failures:
# - php: 7.0
# - php: hhvm
sudo: false
env:
global:
- DIRECTUS_DB_NAME=directus_test
- DIRECTUS_DB_PASSWORD=
- DIRECTUS_DB_USER=root
- DIRECTUS_ADMIN_EMAIL=admin@getdirectus.com
- DIRECTUS_ADMIN_TOKEN=token
- DIRECTUS_ADMIN_PASSWORD=password
- DIRECTUS_SITE_NAME=Directus
matrix:
- MYSQL_VERSION=5.5 DIRECTUS_TEST_MODE=IO
before_install:
- mysql -V
- mysql -uroot -e "DROP DATABASE IF EXISTS $DIRECTUS_DB_NAME;"
- mysql -uroot -e "CREATE DATABASE $DIRECTUS_DB_NAME;"
- mysql -uroot -e 'SHOW DATABASES;'
- sudo apt-get update
- sudo apt-get install -y apache2 libapache2-mod-fastcgi
- # enable php-fpm
- ls ~/.phpenv/versions/$(phpenv version-name)/etc
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- ls ~/.phpenv/versions/$(phpenv version-name)/etc
- if [ $TRAVIS_PHP_VERSION != '5.6' ]; then sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf; fi
- ls ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
- # configure apache virtual hosts
- sudo cp -f tests/assets/travis-ci-apache /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- if [ $TRAVIS_PHP_VERSION != 'hhvm']; then sudo apt-get install php$(phpenv version-name)-gd; fi
- sudo service apache2 restart
before_script:
- cp phpunit.xml.dist phpunit.xml
- mysql -uroot $DIRECTUS_DB_NAME < tests/db.sql
- composer install
- bin/directus install:config -h "localhost" -P 3306 -n "$DIRECTUS_DB_NAME" -u "$DIRECTUS_DB_USER" -e "$DIRECTUS_ADMIN_EMAIL"
- # bin/directus install:database
- # bin/directus install:install -e "$DIRECTUS_ADMIN_EMAIL" -p "$DIRECTUS_ADMIN_PASSWORD" -t "$DIRECTUS_SITE_NAME" -T "$DIRECTUS_ADMIN_TOKEN"
script:
# - npm test
- if [ $DIRECTUS_TEST_MODE = 'IO' ]; then vendor/bin/phpunit tests/io --coverage-text --coverage-clover=coverage.clover; fi
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- if [[ $TRAVIS_PHP_VERSION != 'hhvm' && $TRAVIS_PHP_VERSION != '7.0' ]]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi