Set package as private in package.json
[phpmyadmin.git] / .travis.yml
blobf4976e6bab2a9e4a31daac6845ce8400a9eee603
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: "PHPUnit tests in random order"
54   include:
55     - stage: "Lint and analyse code"
56       name: "Lint files"
57       before_install: phpenv config-rm xdebug.ini
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_install: phpenv config-rm xdebug.ini
70       before_script: skip
71       after_script: skip
72       after_success: skip
73       script: composer phpstan
75     - stage: "PHP Unit tests"
76       php: 7.1
77       name: "PHP 7.1"
78       env: CI_MODE=test
80     - stage: "PHP Unit tests"
81       php: 7.2
82       name: "PHP 7.2"
83       env: CI_MODE=test
85     - stage: "PHP Unit tests"
86       php: 7.3
87       name: "PHP 7.3"
88       env: CI_MODE=test
90     - stage: "PHP Unit tests"
91       php: 7.4
92       name: "PHP 7.4"
93       env: CI_MODE=test
94       before_install: phpenv config-rm xdebug.ini
96     - stage: "PHP Unit tests"
97       php: nightly
98       name: "PHP nightly"
99       env: CI_MODE=test
100       install:
101         - composer install --no-interaction --ignore-platform-reqs
102         - yarn install --non-interactive
104     - stage: "PHP Unit tests"
105       name: "OSX"
106       os: osx
107       env: CI_MODE=test
108       language: node_js
109       node_js: 10
110       before_install:
111         - brew link --force gettext
112         - echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
113         - echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
114         - mysql.server start
115         - sleep 5
116         # Enable password access
117         - mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
118       addons:
119         homebrew:
120           packages:
121             - php
122             - composer
123             - mariadb
124           update: true
126     - stage: "PHP Unit tests"
127       name: "Windows"
128       os: windows
129       language: node_js
130       node_js: 10
131       env:
132         - CI_MODE=test
133         - YARN_GPG=no
134       before_install:
135         - choco install php composer
136         - choco install mariadb --version=10.4.8
137         - export PATH=/c/tools/php74:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.4"/bin:$PATH
138         - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
139         - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php74/php.ini ; done
140         - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php74/php.ini
141         - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
143     - stage: "PHP Unit tests"
144       php: 7.1
145       name: "PHP 7.1 with dbase extension"
146       env: CI_MODE=test
147       install:
148         - pecl channel-update pecl.php.net
149         - pecl install dbase
150         - php -m |grep -F 'dbase'
151         - composer install --no-interaction
152         - yarn install --non-interactive
154     - stage: "PHP Unit tests"
155       php: 7.4
156       name: "PHPUnit tests in random order"
157       env: CI_MODE=test
158       script:
159         - scripts/generate-mo --quiet
160         - vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium --order-by=random --stop-on-failure
162     - stage: "Documentation"
163       name: "Build docs"
164       before_script: skip
165       after_script: skip
166       after_success: skip
167       install:
168         - source ~/virtualenv/python3.6/bin/activate
169         - pip install 'Sphinx'
170       script: ./test/ci-docs
172     - stage: "Documentation"
173       name: "Build API docs"
174       before_install: phpenv config-rm xdebug.ini
175       before_script: skip
176       after_script: skip
177       after_success: skip
178       install: composer global require "sami/sami:^4.0"
179       script: $HOME/.composer/vendor/bin/sami.php --no-interaction update ./test/sami-config.php
181     - stage: "Other tests"
182       name: "Build release"
183       before_script: skip
184       after_script: skip
185       after_success: skip
186       install:
187         - source ~/virtualenv/python3.6/bin/activate
188         - pip install 'Sphinx'
189       script: ./scripts/create-release.sh --ci
191     - stage: "Other tests"
192       name: "Run selenium tests on Google Chrome"
193       env:
194         - CI_MODE=selenium
195         - TESTSUITE_SELENIUM_BROWSER=chrome
196         - TESTSUITE_USER=root
197         - TESTSUITE_URL=http://127.0.0.1:8000
198       before_install: phpenv config-rm xdebug.ini
199       install:
200         - ./test/install-browserstack
201         - composer install --no-interaction
202         - yarn install --non-interactive
203         - echo -e "<?php\n\$cfg['UploadDir'] = './test/test_data/';" > config.inc.php
204       script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug
205       addons:
206         apt:
207           packages:
208             - nginx