Translated using Weblate (French)
[phpmyadmin.git] / .travis.yml
blob17eb689255bd4e88faf717ef64683a21566728f1
1 language: php
2 dist: trusty
4 stages:
5   - name: "Lint and analyse code"
6   - name: "PHP Unit tests"
7   - name: "Documentation"
8   - name: "Other tests"
10 install:
11   - composer install --no-interaction
12   - yarn install --non-interactive
14 before_script:
15   - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
16   - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
17   - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
18   - mysql -uroot < sql/create_tables.sql
19   - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
20   - ./test/start-local-server
22 script:
23   - ./scripts/generate-mo --quiet
24   - ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium
26 after_script:
27   - if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi
28   - if [ -f php.log ] ; then cat php.log ; fi
29   - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
30   - if [ -f build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; 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: bash <(curl -s https://codecov.io/bash)
36 jobs:
37   allow_failures:
38     - php: nightly
39     - os: windows
40     - name: "PHP 7.1 with dbase extension"
42   include:
43     - stage: "Lint and analyse code"
44       name: "Lint files"
45       php: 7.1
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       php: 7.1
58       before_script: skip
59       after_script: skip
60       after_success: skip
61       script: composer phpstan
63     - stage: "PHP Unit tests"
64       php: 7.1
65       name: "PHP 7.1"
66       env: CI_MODE=test
68     - stage: "PHP Unit tests"
69       php: 7.2
70       name: "PHP 7.2"
71       env: CI_MODE=test
73     - stage: "PHP Unit tests"
74       php: 7.3
75       name: "PHP 7.3"
76       env: CI_MODE=test
78     - stage: "PHP Unit tests"
79       php: nightly
80       name: "PHP nightly"
81       env: CI_MODE=test
83     - stage: "PHP Unit tests"
84       name: "PHP 7.3"
85       os: osx
86       env: CI_MODE=test
87       language: node_js
88       node_js: 10
89       before_install:
90         - brew link --force gettext
91         - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /usr/local/etc/php/7.2/php.ini
92         - mysql.server start
93       addons:
94         homebrew:
95           packages:
96             - php
97             - composer
98             - mariadb
100     - stage: "PHP Unit tests"
101       name: "PHP 7.2"
102       os: windows
103       language: node_js
104       node_js: 10
105       env: CI_MODE=test
106       before_install:
107         - choco install php composer mariadb
108         - export PATH=/c/tools/php73:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.3"/bin:$PATH
109         - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
110         - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php73/php.ini ; done
111         - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php73/php.ini
112         - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
114     - stage: "PHP Unit tests"
115       name: "PHP 7.1 with dbase extension"
116       php: 7.1
117       env: CI_MODE=test
118       install:
119         - pecl channel-update pecl.php.net
120         - pecl install dbase-7.0.0beta1
121         - composer install --no-interaction
122         - yarn install --non-interactive
124     - stage: "Documentation"
125       name: "Build docs"
126       before_script: skip
127       after_script: skip
128       after_success: skip
129       install:
130         - source ~/virtualenv/python3.6/bin/activate
131         - pip install 'Sphinx'
132       script: ./test/ci-docs
134     - stage: "Documentation"
135       name: "Build API docs"
136       php: 7.1
137       before_script: skip
138       after_script: skip
139       after_success: skip
140       install: composer global require "sami/sami:^4.0"
141       script: $HOME/.composer/vendor/bin/sami.php --no-interaction update ./test/sami-config.php
143     - stage: "Other tests"
144       name: "Build release"
145       php: 7.1
146       before_script: skip
147       after_script: skip
148       after_success: skip
149       install:
150         - source ~/virtualenv/python3.6/bin/activate
151         - pip install 'Sphinx'
152       script: ./scripts/create-release.sh --ci
154     - stage: "Other tests"
155       name: "Run selenium tests on Google Chrome"
156       php: 7.1
157       env:
158         - CI_MODE=selenium
159         - TESTSUITE_SELENIUM_BROWSER=chrome
160         - TESTSUITE_USER=root
161         - TESTSUITE_URL=http://127.0.0.1:8000
162       install:
163         - ./test/install-browserstack
164         - composer install --no-interaction
165         - yarn install --non-interactive
166         - echo -e "<?php\n\$cfg['UploadDir'] = './test/test_data/';" > config.inc.php
167       script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug
168       addons:
169         apt:
170           packages:
171             - nginx
173 cache:
174   pip: true
175   yarn: true
176   directories:
177     - $HOME/.composer/cache/
178     - $HOME/browserstack
179     - node_modules