Translated using Weblate (German)
[phpmyadmin.git] / .travis.yml
blob949412cac3e9e28403ad18b728fed79fe5fca5a3
1 # The Travis setup:
2 # - run testsuite for every PHP version
3 # - run lint for every PHP version
4 # - run Selenium for single PHP version
6 dist: trusty
8 language: php
10 services:
11   - mysql
13 sudo: required
15 install:
16   - if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then source ~/virtualenv/python3.6/bin/activate ; fi
17   - ./test/ci-install-$CI_MODE
18   - if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then case "$TRAVIS_PHP_VERSION" in hhvm*) ;; *) phpenv config-add test/php-noprofile.ini ;; esac ; fi
20 before_script:
21   - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
22   - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
23   - export PATH=~/.composer/vendor/bin/:$PATH
24   - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
25   - mysql -uroot < sql/create_tables.sql
26   - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
27   - ./test/start-local-server
29 script:
30   - ./scripts/generate-mo --quiet
31   - if [ $CI_MODE = test ] ; then ./test/ci-phplint ; fi
32   - ./test/ci-$CI_MODE
34 after_script:
35   - if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi
36   - if [ -f php.log ] ; then cat php.log ; fi
37   - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
38   - if [ -f build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; fi
39   - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
40   - if [ "$CI_MODE" = "selenium" ] ; then ~/browserstack/BrowserStackLocal --daemon stop; fi
42 after_success:
43   - bash <(curl -s https://codecov.io/bash)
45 stages:
46   - name: "PHP Unit tests"
47   - name: "Lint and analyse code"
48   - name: "Documentation"
49   - name: "Other tests"
51 jobs:
52   include:
53     - stage: "Lint and analyse code"
54       name: "Lint PHP files"
55       php: "7.1"
56       env: CI_MODE=lint
57     - stage: "Lint and analyse code"
58       name: "Run phpstan"
59       php: "7.2"
60       env: CI_MODE=phpstan
61     - stage: "Documentation"
62       name: "Build docs"
63       php: "7.1"
64       env: CI_MODE=docs
65     - stage: "Documentation"
66       name: "Build API docs"
67       php: "7.1"
68       env: CI_MODE=apidocs
69     - stage: "PHP Unit tests"
70       name: "PHP 7.2"
71       os: osx
72       language: generic
73       env: CI_MODE=test
74       before_install:
75         - brew update
76         - brew install openldap libiconv php@7.2 composer mariadb yarn
77         - brew link --force gettext
78         - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /usr/local/etc/php/7.2/php.ini
79         - mysql.server start
80     - stage: "PHP Unit tests"
81       php: "7.3"
82       name: "PHP 7.3"
83       env: CI_MODE=test
84     - stage: "PHP Unit tests"
85       php: "7.2"
86       name: "PHP 7.2"
87       env: CI_MODE=test
88     - stage: "PHP Unit tests"
89       php: "7.1"
90       name: "PHP 7.1"
91       env: CI_MODE=test
92     - stage: "PHP Unit tests"
93       php: "nightly"
94       name: "PHP nightly"
95       env: CI_MODE=test
96     - stage: "PHP Unit tests"
97       name: "PHP 7.2"
98       os: windows
99       language: sh
100       env: CI_MODE=test
101       before_install:
102         - choco install php composer mariadb
103         - export PATH=/c/tools/php72:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.2"/bin:$PATH
104         - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
105         - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php72/php.ini ; done
106         - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php72/php.ini
107         - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
108     - stage: "Other tests"
109       name: "Build release"
110       php: "7.1"
111       env: CI_MODE=release
112     - stage: "Other tests"
113       name: "Run selenium tests on Google Chrome"
114       php: "7.1"
115       env:
116         - CI_MODE=selenium
117         - TESTSUITE_SELENIUM_BROWSER=chrome
118         - TESTSUITE_USER=root
119         - TESTSUITE_URL=http://127.0.0.1:8000
120   allow_failures:
121       - php: "nightly"
122         env: CI_MODE=test
123       - php: "7.2"
124         env: CI_MODE=phpstan
125       - os: windows
127 cache:
128   pip: true
129   yarn: true
130   directories:
131     - $HOME/.composer/cache/
132     - $HOME/browserstack
133     - node_modules
134 # Install APT packages
135 #  - git > 2.5.1 needed for worktrees
136 #  - mysql server does not seem to be always present on Travis Trusty environment
137 addons:
138   apt:
139     packages:
140     - git
141     - mysql-server-5.6
142     - nginx