forked from craftcms/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
104 lines (87 loc) · 2.54 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
language: php
dist: trusty
env:
global:
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest""
branches:
only:
- feature/tests
services:
- mysql
- postgresql
matrix:
fast_finish: true
include:
- php: 7.4snapshot
- php: 7.3
- php: 7.2
# Run tests coverage on PHP 7.1
- php: 7.1
env: TASK_TESTS_COVERAGE=1
- php: 7.0
allow_failures:
- php: 7.4snapshot
# Cache some folders to speed things up.
cache:
directories:
- vendor
- $HOME/.composer/cache
- $HOME/.npm
# Try running against postgres 9.6
addons:
postgresql: "9.6"
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server
install:
- |
if [[ $TASK_TESTS_COVERAGE != 1 ]]; then
# disable xdebug for performance reasons when code coverage is not needed.
phpenv config-rm xdebug.ini || echo "xdebug is not installed"
fi
# install composer dependencies
export PATH="$HOME/.composer/vendor/bin:$PATH"
travis_retry composer install $DEFAULT_COMPOSER_FLAGS
touch tests/.env
mkdir tests/_support/_generated
before_script:
- |
# show some version and environment information
php --version
composer --version
php -r "echo INTL_ICU_VERSION . \"\n\";"
php -r "echo INTL_ICU_DATA_VERSION . \"\n\";"
psql --version
mysql --version
# initialize database
- travis_retry mysql -e 'CREATE DATABASE `craft3test`;';
- mysql -e "SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';";
- psql -U postgres -c 'CREATE DATABASE craft3test;';
# install imagick
- pear config-set preferred_state beta
- pecl channel-update pecl.php.net
- yes | pecl install imagick
script:
- |
if [[ $TASK_TESTS_COVERAGE != 1 ]]; then
php -d display_errors=on -d max_execution_time=-1 -d memory_limit=2048M -d error_reporting=-1 vendor/codeception/codeception/codecept run tests/unit\helpers/ArrayHelperTest.php:testToArray;
else
vendor/bin/codecept run unit --coverage --coverage-xml;
fi
#after_script:
# - |
# if [ $TASK_TESTS_COVERAGE == 1 ]; then
# travis_retry wget https://scrutinizer-ci.com/ocular.phar
# php ocular.phar code-coverage:upload --format=php-clover coverage.clover
# fi
#jobs:
# include:
# - stage: Static Code Analysis
# php: 7.3
# env: php-cs-fixer
# install:
# - phpenv config-rm xdebug.ini
# script:
# - php-cs-fixer fix --dry-run -v --show-progress=dots --diff-format=udiff