Extract HTML from Index::generateIndexTypeSelector
[phpmyadmin.git] / .travis.yml
blob3b985407e06843e2acc963c9e21d3369ff3e736d
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   - bash <(curl -Ls https://coverage.codacy.com/get.sh)
38 services:
39   - mysql
41 cache:
42   pip: true
43   yarn: true
44   directories:
45     - $HOME/.composer/cache/
46     - $HOME/browserstack
47     - node_modules
49 jobs:
50   allow_failures:
51     - php: nightly
52     - os: osx
53     - name: "PHPUnit tests in random order"
55   include:
56     - stage: "Lint and analyse code"
57       name: "Lint files"
58       before_install: phpenv config-rm xdebug.ini
59       before_script: skip
60       after_script: skip
61       after_success: skip
62       script:
63         - ./test/ci-phplint
64         - composer phpcs
65         - yarn run js-lint --quiet
66         - yarn run css-lint
68     - stage: "Lint and analyse code"
69       name: "Run phpstan"
70       before_install: phpenv config-rm xdebug.ini
71       before_script: skip
72       after_script: skip
73       after_success: skip
74       script: composer phpstan
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         - brew link --force gettext
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: skip
191       after_success: skip
192       install:
193         - nvm install 10
194         - source ~/virtualenv/python3.6/bin/activate
195         - pip install 'Sphinx'
196       script: ./scripts/create-release.sh --ci
198     - stage: "Other tests"
199       name: "Run selenium tests on Google Chrome"
200       env:
201         - CI_MODE=selenium
202         - TESTSUITE_SELENIUM_BROWSER=chrome
203         - TESTSUITE_USER=root
204         - TESTSUITE_URL=http://127.0.0.1:8000
205       before_install: phpenv config-rm xdebug.ini
206       install:
207         - nvm install 10
208         - ./test/install-browserstack
209         - composer install --no-interaction
210         - yarn install --non-interactive
211         - echo -e "<?php\n\$cfg['UploadDir'] = './test/test_data/';" > config.inc.php
212       script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug
213       addons:
214         apt:
215           packages:
216             - nginx