Translated using Weblate (Portuguese)
[phpmyadmin.git] / .travis.yml
blob5f8c5b5df67b2289b373ce22dbf824eae4dc400b
1 dist: xenial
3 language: php
5 stages:
6   - name: "Lint and analyse code"
7   - name: "PHP Unit tests"
8   - name: "Other tests"
9   - name: "Documentation"
11 install:
12   - nvm install 10
13   - composer install --no-interaction
14   - yarn install --non-interactive
16 script:
17   - ./scripts/generate-mo --quiet
18   - ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium
20 after_script:
21   - if [ -f php.log ] ; then cat php.log ; fi
22   - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
23   - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
25 after_success:
26   - bash <(curl -s https://codecov.io/bash)
27   - 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
28   - 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
30 services:
31   - mysql
33 cache:
34   pip: true
35   yarn: true
36   directories:
37     - $HOME/.composer/cache/
38     - $HOME/browserstack
39     - node_modules
41 jobs:
42   allow_failures:
43     - php: nightly
44     - os: osx
45     - name: "PHPUnit tests in random order"
47   include:
48     - stage: "Lint and analyse code"
49       name: "Lint files"
50       before_install: phpenv config-rm xdebug.ini
51       before_script: skip
52       after_script: skip
53       after_success: skip
54       script:
55         - ./test/ci-phplint
56         - composer phpcs
57         - yarn run js-lint --quiet
58         - yarn run css-lint
60     - stage: "Lint and analyse code"
61       name: "Run phpstan"
62       before_install: phpenv config-rm xdebug.ini
63       before_script: skip
64       after_script: skip
65       after_success: skip
66       script: composer phpstan
68     - stage: "Lint and analyse code"
69       name: "Run psalm"
70       before_install: phpenv config-rm xdebug.ini
71       before_script: skip
72       after_script: skip
73       after_success: skip
74       script: composer psalm
76     - stage: "PHP Unit tests"
77       php: 7.1
78       name: "PHP 7.1"
79       env: CI_MODE=test
81     - stage: "PHP Unit tests"
82       php: 7.2
83       name: "PHP 7.2"
84       env: CI_MODE=test
86     - stage: "PHP Unit tests"
87       php: 7.3
88       name: "PHP 7.3"
89       env: CI_MODE=test
91     - stage: "PHP Unit tests"
92       php: 7.4
93       name: "PHP 7.4"
94       env: CI_MODE=test
95       before_install: phpenv config-rm xdebug.ini
97     - stage: "PHP Unit tests"
98       php: nightly
99       name: "PHP nightly"
100       env: CI_MODE=test
101       install:
102         - composer install --no-interaction --ignore-platform-reqs
103         - nvm install 10
104         - yarn install --non-interactive
106     - stage: "PHP Unit tests"
107       name: "OSX"
108       os: osx
109       env: CI_MODE=test
110       language: node_js
111       node_js: 10
112       before_install:
113         - export PATH="/usr/local/opt/gettext/bin:$PATH"
114         - echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
115         - echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
116         - mysql.server start
117         - sleep 5
118         # Enable password access
119         - mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
120       addons:
121         homebrew:
122           packages:
123             - php
124             - composer
125             - mariadb
126           update: true
128     - stage: "PHP Unit tests"
129       name: "Windows"
130       os: windows
131       language: node_js
132       node_js: 10
133       env:
134         - CI_MODE=test
135         - YARN_GPG=no
136       install:
137         - composer install --no-interaction
138         - yarn install --non-interactive
139       before_install:
140         - choco install php composer
141         - choco install mariadb --version=10.4.8
142         - export PATH=/c/tools/php74:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.4"/bin:$PATH
143         - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
144         - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php74/php.ini ; done
145         - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php74/php.ini
146         - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
148     - stage: "PHP Unit tests"
149       php: 7.1
150       name: "PHP 7.1 with dbase extension"
151       env: CI_MODE=test
152       install:
153         - pecl channel-update pecl.php.net
154         - pecl install dbase
155         - php -m |grep -F 'dbase'
156         - composer install --no-interaction
157         - nvm install 10
158         - yarn install --non-interactive
160     - stage: "PHP Unit tests"
161       php: 7.4
162       name: "PHPUnit tests in random order"
163       env: CI_MODE=test
164       script:
165         - scripts/generate-mo --quiet
166         - vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium --order-by=random --stop-on-failure
168     - stage: "Documentation"
169       name: "Build docs"
170       before_script: skip
171       after_script: skip
172       after_success: skip
173       install:
174         - source ~/virtualenv/python3.6/bin/activate
175         - pip install 'Sphinx'
176       script: ./test/ci-docs
178     - stage: "Documentation"
179       name: "Build API docs"
180       before_install: phpenv config-rm xdebug.ini
181       before_script: skip
182       after_script: skip
183       after_success: skip
184       install: composer global require "sami/sami:^4.0"
185       script: $HOME/.composer/vendor/bin/sami.php --no-interaction update ./test/sami-config.php
187     - stage: "Other tests"
188       name: "Build release"
189       before_script: skip
190       after_script:
191         # Mark Codacy coverage final here because all steps of the previous stage did succeed
192         - bash <(curl -Ls https://coverage.codacy.com/get.sh) final
193       after_success: skip
194       install:
195         - nvm install 10
196         - source ~/virtualenv/python3.6/bin/activate
197         - pip install 'Sphinx'
198       script: ./scripts/create-release.sh --ci
200     - stage: "Other tests"
201       name: "Run selenium tests on Google Chrome"
202       env:
203         - CI_MODE=selenium
204         - TESTSUITE_SELENIUM_BROWSER=chrome
205         - TESTSUITE_USER=root
206         - TESTSUITE_URL=http://127.0.0.1:8000
207       before_script:
208         - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
209         - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
210         - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
211         - mysql -uroot < sql/create_tables.sql
212         - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
213         - ./test/start-local-server
214       after_script:
215         - ~/browserstack/BrowserStackLocal --daemon stop
216       before_install: phpenv config-rm xdebug.ini
217       install:
218         - nvm install 10
219         - ./test/install-browserstack
220         - composer install --no-interaction
221         - yarn install --non-interactive
222         - cp test/config.e2e.inc.php config.inc.php
223       script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug
224       addons:
225         apt:
226           packages:
227             - nginx