Translated using Weblate (English (United Kingdom))
[phpmyadmin.git] / .travis.yml
blobcaa3beb5a8cf4a7b25fed0a10fbe9d9421c33bc8
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: xenial
8 language: php
10 services:
11   - mysql
13 php:
14   - "7.3"
15   - "7.2"
16   - "7.1"
17   - "7.0"
18   - "5.6"
19   - "hhvm-3.12"
20   - "hhvm-3.18"
21   - "hhvm-3.21"
22   - "hhvm-3.24"
23   - "hhvm-3.27"
25 env:
26   matrix:
27     - CI_MODE=test
28   global:
29     - TESTSUITE_USER=root
30     - TESTSUITE_URL=http://127.0.0.1:8000
32 install:
33   - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then source ~/virtualenv/python3.6/bin/activate ; fi
34   - ./test/ci-install-$CI_MODE
35   - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then case "$TRAVIS_PHP_VERSION" in hhvm*) ;; *) phpenv config-add test/php-noprofile.ini ;; esac ; fi
37 before_script:
38   - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
39   - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
40   - export PATH=~/.composer/vendor/bin/:$PATH
41   - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
42   - mysql -uroot < sql/create_tables.sql
43   - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
44   - ./test/start-local-server
46 script:
47   - ./scripts/generate-mo --quiet
48   - if [ $CI_MODE = test ] ; then ./test/ci-lint ; fi
49   - ./test/ci-$CI_MODE
51 after_script:
52   - if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi
53   - if [ -f php.log ] ; then cat php.log ; fi
54   - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
55   - if [ -f build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; fi
56   - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
58 after_success:
59   - bash <(curl -s https://codecov.io/bash)
61 matrix:
62   fast_finish: true
63   include:
64     - php: "7.1"
65       env: CI_MODE=selenium
66       before_install: phpenv config-rm xdebug.ini
67     - php: "7.0"
68       node_js: 10
69       env: CI_MODE=release
70     - php: "7.1"
71       env: CI_MODE=docs
72     - php: "7.1"
73       env: CI_MODE=apidocs
74       before_install: phpenv config-rm xdebug.ini
75     - os: osx
76       name: "PHP 7.4"
77       language: node_js
78       node_js: 10
79       env: CI_MODE=test
80       before_install:
81         - brew link --force gettext
82         - echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
83         - echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
84         - mysql.server start
85         - sleep 5
86         # Enable password access
87         - mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
88       install:
89         - composer require --no-interaction php>=7.1
90         - composer remove phpunit/phpunit-selenium --dev --no-interaction
91         - composer remove phpunit/phpunit --dev --no-interaction
92         - composer require --dev --no-interaction phpunit/phpunit ^8
93         - rm -rf test/selenium
94         - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i.bak~ 's/function setUpBeforeClass()/function setUpBeforeClass(): void/g'"
95         - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i.bak~ 's/function setUp()/function setUp(): void/g'"
96         - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i.bak~ 's/function tearDown()/function tearDown(): void/g'"
97       addons:
98         homebrew:
99           packages:
100             - php
101             - composer
102             - mariadb
103           update: true
104     - php: "5.5"
105       env: CI_MODE=test
106       dist: trusty
107       script:
108         - ./scripts/generate-mo --quiet
109         - ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium,git-revision,network
110     - php: "7.3"
111       env: CI_MODE=test
112       name: "Run tests using phpunit 8"
113       install:
114        - composer require --no-interaction php>=7.1
115        - composer remove phpunit/phpunit-selenium --dev --no-interaction
116        - composer remove phpunit/phpunit --dev --no-interaction
117        - composer require --dev --no-interaction phpunit/phpunit ^8
118        - rm -rf test/selenium
119        - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function setUpBeforeClass()/function setUpBeforeClass(): void/g'"
120        - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function setUp()/function setUp(): void/g'"
121        - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function tearDown()/function tearDown(): void/g'"
122     - php: "7.4"
123       env: CI_MODE=test
124       name: "PHP: 7.4"
125       install:
126        - composer require --no-interaction php>=7.1
127        - composer remove phpunit/phpunit-selenium --dev --no-interaction
128        - composer remove phpunit/phpunit --dev --no-interaction
129        - composer require --dev --no-interaction phpunit/phpunit ^8
130        - rm -rf test/selenium
131        - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function setUpBeforeClass()/function setUpBeforeClass(): void/g'"
132        - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function setUp()/function setUp(): void/g'"
133        - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function tearDown()/function tearDown(): void/g'"
134        - phpenv config-rm xdebug.ini
135     - php: "7.1"
136       env: CI_MODE=test DBASE=true
137       install:
138         - pecl channel-update pecl.php.net
139         - pecl install dbase
140         - test/ci-install-test
141     - php: "5.6"
142       env: CI_MODE=test DBASE=true
143       install:
144         - pecl channel-update pecl.php.net
145         - pecl install dbase-5.1.1
146         - test/ci-install-test
147     - php: "nightly"
148       env: CI_MODE=test
149       install:
150         - composer install --no-interaction --ignore-platform-reqs
151     - php: "7.1"
152       before_script: skip
153       after_script: skip
154       after_success: skip
155       script:
156         - test/ci-lint
157         - vendor/bin/phpcs --standard=phpcs.xml.dist
159   allow_failures:
160     - os: osx
161     - php: "nightly"
162     - env: CI_MODE=test DBASE=true
163     - env: CI_MODE=docs
165 cache:
166   pip: true
167   directories:
168     - $HOME/.composer/cache/
169     - $HOME/browserstack
170     - $HOME/runkit
171 # Install APT packages
172 #  - git > 2.5.1 needed for worktrees
173 #  - mysql server does not seem to be always present on Travis Trusty environment
174 addons:
175   apt:
176     packages:
177     - git
178     - nginx