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