forked from phpmyadmin/phpmyadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
231 lines (207 loc) · 7.06 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
dist: xenial
language: php
stages:
- name: "Lint and analyse code"
- name: "PHP Unit tests"
- name: "Other tests"
- name: "Documentation"
install:
- nvm install 10
- composer install --no-interaction
- yarn install --non-interactive
script:
- ./scripts/generate-mo --quiet
- ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium
after_success:
- bash <(curl -s https://codecov.io/bash)
- if [ -f build/logs/clover.xml ] ; then curl -LsO https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
- if [ -f build/logs/clover.xml ] ; then bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l php -r build/logs/clover.xml --partial; fi
services:
- mysql
cache:
pip: true
yarn: true
directories:
- $HOME/.composer/cache/
- node_modules
jobs:
allow_failures:
- php: nightly
- os: osx
- name: "PHPUnit tests in random order"
include:
- stage: "Lint and analyse code"
name: "Lint files"
before_install: phpenv config-rm xdebug.ini
before_script: skip
after_script: skip
after_success: skip
script:
- ./test/ci-phplint
- composer phpcs
- yarn run js-lint --quiet
- yarn run css-lint
- php scripts/console lint:twig templates --show-deprecations
- stage: "Lint and analyse code"
name: "Run phpstan"
before_install: phpenv config-rm xdebug.ini
before_script: skip
after_script: skip
after_success: skip
script: composer phpstan -- --memory-limit 2G
- stage: "Lint and analyse code"
name: "Run psalm"
before_install: phpenv config-rm xdebug.ini
before_script: skip
after_script: skip
after_success: skip
script: composer psalm
- stage: "PHP Unit tests"
php: 7.1
name: "PHP 7.1"
env: CI_MODE=test
- stage: "PHP Unit tests"
php: 7.2
name: "PHP 7.2"
env: CI_MODE=test
- stage: "PHP Unit tests"
php: 7.3
name: "PHP 7.3"
env: CI_MODE=test
- stage: "PHP Unit tests"
php: 7.4
name: "PHP 7.4"
env: CI_MODE=test
before_install: phpenv config-rm xdebug.ini
- stage: "PHP Unit tests"
php: nightly
name: "PHP nightly"
env: CI_MODE=test
install:
- composer install --no-interaction --ignore-platform-reqs
- nvm install 10
- yarn install --non-interactive
- stage: "PHP Unit tests"
name: "OSX"
os: osx
env: CI_MODE=test
language: node_js
node_js: 10
before_install:
- export PATH="/usr/local/opt/gettext/bin:$PATH"
- echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
- echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
- mysql.server start
- sleep 5
# Enable password access
- mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
addons:
homebrew:
packages:
- php
- composer
- mariadb
update: true
- stage: "PHP Unit tests"
name: "Windows"
os: windows
language: node_js
node_js: 10
env:
- CI_MODE=test
- YARN_GPG=no
install:
- composer install --no-interaction
- yarn install --non-interactive
before_install:
- choco install php composer
- choco install mariadb --version=10.4.8
- export PATH=/c/tools/php74:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.4"/bin:$PATH
- PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
- for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php74/php.ini ; done
- sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php74/php.ini
- find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
- stage: "PHP Unit tests"
php: 7.1
name: "PHP 7.1 with dbase extension"
env: CI_MODE=test
install:
- pecl channel-update pecl.php.net
- pecl install dbase
- php -m |grep -F 'dbase'
- composer install --no-interaction
- nvm install 10
- yarn install --non-interactive
- stage: "PHP Unit tests"
php: 7.4
name: "PHPUnit tests in random order"
env: CI_MODE=test
script:
- scripts/generate-mo --quiet
- vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium --order-by=random --stop-on-failure
- stage: "Documentation"
name: "Build docs"
before_script: skip
after_script: skip
after_success: skip
install:
- source ~/virtualenv/python3.6/bin/activate
- pip install 'Sphinx'
script: ./test/ci-docs
- stage: "Documentation"
name: "Build API docs"
before_install: phpenv config-rm xdebug.ini
before_script: skip
after_script: skip
after_success: skip
install: composer global require "code-lts/doctum:^5.0"
script: $HOME/.composer/vendor/bin/doctum.php --no-interaction update ./test/doctum-config.php
- stage: "Other tests"
name: "Build release"
before_script: skip
after_script:
# Mark Codacy coverage final here because all steps of the previous stage did succeed
- bash <(curl -Ls https://coverage.codacy.com/get.sh) final
after_success: skip
install:
- nvm install 10
- source ~/virtualenv/python3.6/bin/activate
- pip install 'Sphinx'
script: ./scripts/create-release.sh --ci
- stage: "Other tests"
name: "Run selenium tests on Google Chrome"
env:
- CI_MODE=selenium
- TESTSUITE_SELENIUM_BROWSER=chrome
- TESTSUITE_USER=root
- TESTSUITE_URL=http://127.0.0.1:8000
- TESTSUITE_SERVER="127.0.0.1"
- TESTSUITE_DATABASE="selenium"
- TESTSUITE_SELENIUM_HOST="127.0.0.1"
- TESTSUITE_SELENIUM_PORT="4444"
- SKIP_STANDALONE=1
before_install:
- docker run -d -e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1080 --rm --name=selenium --net=host -v /dev/shm:/dev/shm selenium/standalone-chrome:3.141.59
- phpenv config-rm xdebug.ini
- cp test/config.e2e.inc.php config.inc.php
before_script:
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
- mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
- mysql -uroot < sql/create_tables.sql
- mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
- ./test/start-local-server
script: ./vendor/bin/phpunit --no-coverage --group selenium --verbose --debug
after_script:
- if [ -f php.log ] ; then cat php.log ; fi
- if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
- if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
- ./test/stop-local-server
- docker logs selenium
- docker stop selenium
services:
- docker
- mysql
addons:
apt:
packages:
- nginx