Translated using Weblate (French)
[phpmyadmin.git] / .travis.yml
blobad76696ab8cf5eafedf3e4c3e6dd764eeff011d2
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   - composer install --no-interaction
13   - yarn install --non-interactive
15 before_script:
16   - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
17   - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
18   - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
19   - mysql -uroot < sql/create_tables.sql
20   - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
21   - ./test/start-local-server
23 script:
24   - ./scripts/generate-mo --quiet
25   - ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium
27 after_script:
28   - if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi
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 build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; 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
52     - name: "PHP 7.1 with dbase extension"
53     - name: "PHP 7.4"
55   include:
56     - stage: "Lint and analyse code"
57       name: "Lint files"
58       before_script: skip
59       after_script: skip
60       after_success: skip
61       script:
62         - ./test/ci-phplint
63         - composer phpcs
64         - yarn run js-lint --quiet
65         - yarn run css-lint
67     - stage: "Lint and analyse code"
68       name: "Run phpstan"
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.4snapshot
91       name: "PHP 7.4"
92       env: CI_MODE=test
94     - stage: "PHP Unit tests"
95       php: nightly
96       name: "PHP nightly"
97       env: CI_MODE=test
98       install:
99         - composer install --no-interaction --ignore-platform-reqs
100         - yarn install --non-interactive
102     - stage: "PHP Unit tests"
103       name: "OSX"
104       os: osx
105       env: CI_MODE=test
106       language: node_js
107       node_js: 10
108       before_install:
109         - brew link --force gettext
110         - echo "memory_limit=-1" > /usr/local/etc/php/7.3/conf.d/50-travis.ini
111         - echo "pcre.jit=0" >> /usr/local/etc/php/7.3/conf.d/50-travis.ini
112         - mysql.server start
113       addons:
114         homebrew:
115           packages:
116             - php
117             - composer
118             - mariadb
119           update: true
121     - stage: "PHP Unit tests"
122       name: "Windows"
123       os: windows
124       language: node_js
125       node_js: 10
126       env:
127         - CI_MODE=test
128         - YARN_GPG=no
129       before_install:
130         - choco install php composer mariadb
131         - export PATH=/c/tools/php73:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.4"/bin:$PATH
132         - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
133         - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php73/php.ini ; done
134         - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php73/php.ini
135         - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
137     - stage: "PHP Unit tests"
138       php: 7.1
139       name: "PHP 7.1 with dbase extension"
140       env: CI_MODE=test
141       install:
142         - pecl channel-update pecl.php.net
143         - pecl install dbase-7.0.0beta1
144         - composer install --no-interaction
145         - yarn install --non-interactive
147     - stage: "Documentation"
148       name: "Build docs"
149       before_script: skip
150       after_script: skip
151       after_success: skip
152       install:
153         - source ~/virtualenv/python3.6/bin/activate
154         - pip install 'Sphinx'
155       script: ./test/ci-docs
157     - stage: "Documentation"
158       name: "Build API docs"
159       before_script: skip
160       after_script: skip
161       after_success: skip
162       install: composer global require "sami/sami:^4.0"
163       script: $HOME/.composer/vendor/bin/sami.php --no-interaction update ./test/sami-config.php
165     - stage: "Other tests"
166       name: "Build release"
167       before_script: skip
168       after_script: skip
169       after_success: skip
170       install:
171         - source ~/virtualenv/python3.6/bin/activate
172         - pip install 'Sphinx'
173       script: ./scripts/create-release.sh --ci
175     - stage: "Other tests"
176       name: "Run selenium tests on Google Chrome"
177       env:
178         - CI_MODE=selenium
179         - TESTSUITE_SELENIUM_BROWSER=chrome
180         - TESTSUITE_USER=root
181         - TESTSUITE_URL=http://127.0.0.1:8000
182       install:
183         - ./test/install-browserstack
184         - composer install --no-interaction
185         - yarn install --non-interactive
186         - echo -e "<?php\n\$cfg['UploadDir'] = './test/test_data/';" > config.inc.php
187       script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug
188       addons:
189         apt:
190           packages:
191             - nginx