Translated using Weblate (Czech)
[phpmyadmin.git] / .travis.yml
blob18f84c42ebb3b76b97a42504102a2e1f31911286
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 vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi
30   - if [ -f php.log ] ; then cat php.log ; fi
31   - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
32   - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
33   - if [ "$CI_MODE" = "selenium" ] ; then ~/browserstack/BrowserStackLocal --daemon stop; fi
35 after_success: bash <(curl -s https://codecov.io/bash)
37 services:
38   - mysql
40 cache:
41   pip: true
42   yarn: true
43   directories:
44     - $HOME/.composer/cache/
45     - $HOME/browserstack
46     - node_modules
48 jobs:
49   allow_failures:
50     - php: nightly
51     - os: osx
53   include:
54     - stage: "Lint and analyse code"
55       name: "Lint files"
56       before_install: phpenv config-rm xdebug.ini
57       before_script: skip
58       after_script: skip
59       after_success: skip
60       script:
61         - ./test/ci-phplint
62         - composer phpcs
63         - yarn run js-lint --quiet
64         - yarn run css-lint
66     - stage: "Lint and analyse code"
67       name: "Run phpstan"
68       before_install: phpenv config-rm xdebug.ini
69       before_script: skip
70       after_script: skip
71       after_success: skip
72       script: composer phpstan
74     - stage: "PHP Unit tests"
75       php: 7.1
76       name: "PHP 7.1"
77       env: CI_MODE=test
79     - stage: "PHP Unit tests"
80       php: 7.2
81       name: "PHP 7.2"
82       env: CI_MODE=test
84     - stage: "PHP Unit tests"
85       php: 7.3
86       name: "PHP 7.3"
87       env: CI_MODE=test
89     - stage: "PHP Unit tests"
90       php: 7.4
91       name: "PHP 7.4"
92       env: CI_MODE=test
93       before_install: phpenv config-rm xdebug.ini
95     - stage: "PHP Unit tests"
96       php: nightly
97       name: "PHP nightly"
98       env: CI_MODE=test
99       install:
100         - nvm install 10
101         - composer install --no-interaction --ignore-platform-reqs
102         - yarn install --non-interactive
104     - stage: "PHP Unit tests"
105       name: "OSX"
106       os: osx
107       env: CI_MODE=test
108       language: node_js
109       node_js: 10
110       before_install:
111         - export PATH="/usr/local/opt/gettext/bin:$PATH"
112         - echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
113         - echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
114         - mysql.server start
115         - sleep 5
116         # Enable password access
117         - mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
118       addons:
119         homebrew:
120           packages:
121             - php
122             - composer
123             - mariadb
124           update: true
126     - stage: "PHP Unit tests"
127       name: "Windows"
128       os: windows
129       language: node_js
130       node_js: 10
131       env:
132         - CI_MODE=test
133         - YARN_GPG=no
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'
142       install:
143         - composer install --no-interaction
144         - yarn install --non-interactive
146     - stage: "PHP Unit tests"
147       php: 7.1
148       name: "PHP 7.1 with dbase extension"
149       env: CI_MODE=test
150       install:
151         - nvm install 10
152         - pecl channel-update pecl.php.net
153         - pecl install dbase
154         - php -m |grep -F 'dbase'
155         - composer install --no-interaction
156         - yarn install --non-interactive
158     - stage: "Documentation"
159       name: "Build docs"
160       before_script: skip
161       after_script: skip
162       after_success: skip
163       install:
164         - source ~/virtualenv/python3.6/bin/activate
165         - pip install 'Sphinx'
166       script: ./test/ci-docs
168     - stage: "Documentation"
169       name: "Build API docs"
170       before_install: phpenv config-rm xdebug.ini
171       before_script: skip
172       after_script: skip
173       after_success: skip
174       install: composer global require "sami/sami:^4.0"
175       script: $HOME/.composer/vendor/bin/sami.php --no-interaction update ./test/sami-config.php
177     - stage: "Other tests"
178       name: "Build release"
179       before_script: skip
180       after_script: skip
181       after_success: skip
182       install:
183         - nvm install 10
184         - source ~/virtualenv/python3.6/bin/activate
185         - pip install 'Sphinx'
186       script: ./scripts/create-release.sh --ci
188     - stage: "Other tests"
189       name: "Run selenium tests on Google Chrome"
190       env:
191         - CI_MODE=selenium
192         - TESTSUITE_SELENIUM_BROWSER=chrome
193         - TESTSUITE_USER=root
194         - TESTSUITE_URL=http://127.0.0.1:8000
195       before_install: phpenv config-rm xdebug.ini
196       install:
197         - nvm install 10
198         - ./test/install-browserstack
199         - composer install --no-interaction
200         - yarn install --non-interactive
201         - echo -e "<?php\n\$cfg['UploadDir'] = './test/test_data/';" > config.inc.php
202       script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug
203       addons:
204         apt:
205           packages:
206             - nginx