Translated using Weblate (Thai)
[phpmyadmin.git] / .travis.yml
blobc58d811d5e0df4326d6e3ca573f44d2e9ea06722
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   - composer run phpunit -- --exclude-group selenium
20 cache:
21   pip: true
22   yarn: true
23   directories:
24     - $HOME/.composer/cache/
25     - node_modules
27 jobs:
28   allow_failures:
29     - php: nightly
30     - os: osx
31     # https://github.com/phpmyadmin/phpmyadmin/issues/16479
32     - name: "Run selenium tests on Google Chrome"
34   include:
35     - stage: "PHP Unit tests"
36       php: nightly
37       name: "PHP nightly"
38       env: CI_MODE=test
39       install:
40         - composer install --no-interaction --ignore-platform-reqs
41         - nvm install 10
42         - yarn install --non-interactive
44     - stage: "PHP Unit tests"
45       name: "OSX"
46       os: osx
47       env: CI_MODE=test
48       language: node_js
49       node_js: 10
50       before_install:
51         - export PATH="/usr/local/opt/gettext/bin:$PATH"
52         - echo "memory_limit=-1" > /usr/local/etc/php/8.0/conf.d/50-travis.ini
53         - echo "pcre.jit=0" >> /usr/local/etc/php/8.0/conf.d/50-travis.ini
54       addons:
55         homebrew:
56           packages:
57             - php@8.0
58             - composer
59           update: true
61     - stage: "PHP Unit tests"
62       name: "Windows"
63       os: windows
64       language: node_js
65       node_js: 10
66       env:
67         - CI_MODE=test
68         - YARN_GPG=no
69       install:
70         - composer install --no-interaction --ignore-platform-reqs
71         - yarn install --non-interactive
72       before_install:
73         - choco install php composer
74         - export PATH=/c/tools/php80:/c/ProgramData/ComposerSetup/bin:$PATH
75         - PHP_EXTENSIONS="mysqli curl bz2 gd2"
76         - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php80/php.ini ; done
77         - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php80/php.ini
79     - stage: "Other tests"
80       name: "Run selenium tests on Google Chrome"
81       env:
82         - CI_MODE=selenium
83         - TESTSUITE_SELENIUM_BROWSER=chrome
84         - TESTSUITE_USER=root
85         - TESTSUITE_URL=http://127.0.0.1:8000
86         - TESTSUITE_SERVER="127.0.0.1"
87         - TESTSUITE_DATABASE="selenium"
88         - TESTSUITE_SELENIUM_HOST="127.0.0.1"
89         - TESTSUITE_SELENIUM_PORT="4444"
90         - SKIP_STANDALONE=1
91       before_install:
92         - 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
93         - phpenv config-rm xdebug.ini
94         - cp test/config.e2e.inc.php config.inc.php
95       before_script:
96         - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
97         - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
98         - mysql -uroot < sql/create_tables.sql
99         - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
100         - ./test/start-local-server
101       script: ./vendor/bin/phpunit --no-coverage --group selenium --verbose --debug
102       after_script:
103         - if [ -f php.log ] ; then cat php.log ; fi
104         - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
105         - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
106         - ./test/stop-local-server
107         - docker logs selenium
108         - docker stop selenium
109       services:
110         - docker
111         - mysql
112       addons:
113         apt:
114           packages:
115             - nginx