forked from phalcon/cphalcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
135 lines (110 loc) · 3.21 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
123
124
125
126
127
128
129
130
131
132
133
134
135
sudo: false
language: php
php:
# PHP 7.4 is not ready yet
# - 'master'
- '7.3'
- '7.2'
git:
depth: 1
branches:
only:
- master
- /^(4|5)\.\d+\.(\d+|x)$/
- /^T\d+-[a-zA-Z-]+/
addons:
apt:
packages:
- gdb
- lcov
postgresql: "9.4"
matrix:
fast_finish: true
# PHP 7.4 is not ready yet
# allow_failures:
# - php: 'master'
cache:
apt: true
timeout: 604800
directories:
- ${HOME}/.composer/cache
- ${HOME}/pear
- ${HOME}/.local/opt
services:
- mysql
- mongodb
- redis-server
- postgresql
env:
global:
- CC="gcc"
- ZEPHIR_VERSION="0.11.9"
- ZEPHIR_PARSER_VERSION="v1.2.0"
- RE2C_VERSION="1.1.1"
- REPORT_COVERAGE=1
- PATH="${HOME}/.composer/vendor/bin:${PATH}"
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest"
before_install:
- |
# General settings
set -e
stty cols 120
ulimit -c unlimited -S || true
if [ ! -z "${GITHUB_TOKEN}" ]; then
composer config github-oauth.github.com ${GITHUB_TOKEN}
printf "Add GitHub token\n"
fi
[ -d ~/bin ] || mkdir ~/bin
git config --global advice.detachedHead false
# Export tests environment variables
source tests/_ci/environment
export $(cut -d= -f1 tests/_ci/environment)
# Export build environment variables
export PHP_MAJOR="$(php -r 'echo phpversion();' | cut -d '.' -f 1)"
export PHP_MINOR="$(php -r 'echo phpversion();' | cut -d '.' -f 2)"
export PHP_VERNUM="$(php-config --vernum)"
export PHP_PEAR_PHP_BIN=$(phpenv which php)
install:
- .ci/install-mysql-5.7.sh
- tests/_ci/setup-dbs.sh
- tests/_ci/pear-setup.sh
- .ci/install-prereqs.sh
- tests/_ci/install-re2c.sh
- travis_retry composer install $DEFAULT_COMPOSER_FLAGS
- wget --no-clobber -O $HOME/bin/zephir https://github.com/phalcon/zephir/releases/download/${ZEPHIR_VERSION}/zephir.phar
- chmod +x $HOME/bin/zephir
before_script:
- |
# Setting up Travis' PHP
echo 'variables_order = EGPCS' >> $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/travis.ini
echo 'session.save_path = "/tmp"' >> $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/travis.ini
echo 'opcache.enable_cli = 1' >> $(phpenv root)/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- tests/_ci/build.sh
script:
# Does not ready to work PHP 7.3
- if [ "$PHP_VERNUM" -ge "70300" ]; then phpenv config-rm xdebug.ini || true; fi
- vendor/bin/codecept build --quiet
- vendor/bin/codecept run --ext DotReporter tests/cli/
- vendor/bin/codecept run --ext DotReporter tests/integration/
- vendor/bin/codecept run --ext DotReporter tests/unit/
- .ci/run-volt-tests.sh
jobs:
include:
- stage: Static Code Analysis
php: 7.2
env:
- REPORT_COVERAGE=0
install:
- travis_retry composer install $DEFAULT_COMPOSER_FLAGS --ignore-platform-reqs
before_script:
- phpenv config-rm xdebug.ini || true
script:
- vendor/bin/phpcs
after_failure:
- tests/_ci/after-failure.sh
after_success:
# Does not ready to work PHP 7.3
- if [ "$PHP_VERNUM" -ge "70300" ]; then export REPORT_COVERAGE=0; fi
- tests/_ci/after-success.sh
notifications:
email: false