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