6 - name: "Lint and analyse code"
7 - name: "PHP Unit tests"
9 - name: "Documentation"
13 - composer install --no-interaction
14 - yarn install --non-interactive
17 - ./scripts/generate-mo --quiet
18 - ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium
21 - if [ -f php.log ] ; then cat php.log ; fi
22 - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
23 - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
26 - bash <(curl -s https://codecov.io/bash)
27 - if [ -f build/logs/clover.xml ] ; then curl -LsO https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi
28 - if [ -f build/logs/clover.xml ] ; then bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l php -r build/logs/clover.xml --partial; fi
37 - $HOME/.composer/cache/
45 - name: "PHPUnit tests in random order"
48 - stage: "Lint and analyse code"
50 before_install: phpenv config-rm xdebug.ini
57 - yarn run js-lint --quiet
60 - stage: "Lint and analyse code"
62 before_install: phpenv config-rm xdebug.ini
66 script: composer phpstan
68 - stage: "Lint and analyse code"
70 before_install: phpenv config-rm xdebug.ini
74 script: composer psalm
76 - stage: "PHP Unit tests"
81 - stage: "PHP Unit tests"
86 - stage: "PHP Unit tests"
91 - stage: "PHP Unit tests"
95 before_install: phpenv config-rm xdebug.ini
97 - stage: "PHP Unit tests"
102 - composer install --no-interaction --ignore-platform-reqs
104 - yarn install --non-interactive
106 - stage: "PHP Unit tests"
113 - export PATH="/usr/local/opt/gettext/bin:$PATH"
114 - echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
115 - echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
118 # Enable password access
119 - mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
128 - stage: "PHP Unit tests"
137 - composer install --no-interaction
138 - yarn install --non-interactive
140 - choco install php composer
141 - choco install mariadb --version=10.4.8
142 - export PATH=/c/tools/php74:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.4"/bin:$PATH
143 - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
144 - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php74/php.ini ; done
145 - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php74/php.ini
146 - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
148 - stage: "PHP Unit tests"
150 name: "PHP 7.1 with dbase extension"
153 - pecl channel-update pecl.php.net
155 - php -m |grep -F 'dbase'
156 - composer install --no-interaction
158 - yarn install --non-interactive
160 - stage: "PHP Unit tests"
162 name: "PHPUnit tests in random order"
165 - scripts/generate-mo --quiet
166 - vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium --order-by=random --stop-on-failure
168 - stage: "Documentation"
174 - source ~/virtualenv/python3.6/bin/activate
175 - pip install 'Sphinx'
176 script: ./test/ci-docs
178 - stage: "Documentation"
179 name: "Build API docs"
180 before_install: phpenv config-rm xdebug.ini
184 install: composer global require "sami/sami:^4.0"
185 script: $HOME/.composer/vendor/bin/sami.php --no-interaction update ./test/sami-config.php
187 - stage: "Other tests"
188 name: "Build release"
191 # Mark Codacy coverage final here because all steps of the previous stage did succeed
192 - bash <(curl -Ls https://coverage.codacy.com/get.sh) final
196 - source ~/virtualenv/python3.6/bin/activate
197 - pip install 'Sphinx'
198 script: ./scripts/create-release.sh --ci
200 - stage: "Other tests"
201 name: "Run selenium tests on Google Chrome"
204 - TESTSUITE_SELENIUM_BROWSER=chrome
205 - TESTSUITE_USER=root
206 - TESTSUITE_URL=http://127.0.0.1:8000
208 - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
209 - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
210 - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
211 - mysql -uroot < sql/create_tables.sql
212 - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
213 - ./test/start-local-server
215 - ~/browserstack/BrowserStackLocal --daemon stop
216 before_install: phpenv config-rm xdebug.ini
219 - ./test/install-browserstack
220 - composer install --no-interaction
221 - yarn install --non-interactive
222 - cp test/config.e2e.inc.php config.inc.php
223 script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug