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