6 - name: "Lint and analyse code"
7 - name: "PHP Unit tests"
8 - name: "Documentation"
13 - composer install --no-interaction
14 - yarn install --non-interactive
17 - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
18 - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
19 - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
20 - mysql -uroot < sql/create_tables.sql
21 - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
22 - ./test/start-local-server
25 - ./scripts/generate-mo --quiet
26 - ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium
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 config.inc.php ] ; then rm -rf config.inc.php; fi
32 - if [ "$CI_MODE" = "selenium" ] ; then ~/browserstack/BrowserStackLocal --daemon stop; fi
35 - bash <(curl -s https://codecov.io/bash)
36 - 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
37 - 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
46 - $HOME/.composer/cache/
54 - name: "PHPUnit tests in random order"
57 - stage: "Lint and analyse code"
59 before_install: phpenv config-rm xdebug.ini
66 - yarn run js-lint --quiet
69 - stage: "Lint and analyse code"
71 before_install: phpenv config-rm xdebug.ini
75 script: composer phpstan
77 - stage: "Lint and analyse code"
79 before_install: phpenv config-rm xdebug.ini
83 script: composer psalm
85 - stage: "PHP Unit tests"
90 - stage: "PHP Unit tests"
95 - stage: "PHP Unit tests"
100 - stage: "PHP Unit tests"
104 before_install: phpenv config-rm xdebug.ini
106 - stage: "PHP Unit tests"
111 - composer install --no-interaction --ignore-platform-reqs
113 - yarn install --non-interactive
115 - stage: "PHP Unit tests"
122 - export PATH="/usr/local/opt/gettext/bin:$PATH"
123 - echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
124 - echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
127 # Enable password access
128 - mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
137 - stage: "PHP Unit tests"
146 - composer install --no-interaction
147 - yarn install --non-interactive
149 - choco install php composer
150 - choco install mariadb --version=10.4.8
151 - export PATH=/c/tools/php74:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.4"/bin:$PATH
152 - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
153 - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php74/php.ini ; done
154 - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php74/php.ini
155 - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
157 - stage: "PHP Unit tests"
159 name: "PHP 7.1 with dbase extension"
162 - pecl channel-update pecl.php.net
164 - php -m |grep -F 'dbase'
165 - composer install --no-interaction
167 - yarn install --non-interactive
169 - stage: "PHP Unit tests"
171 name: "PHPUnit tests in random order"
174 - scripts/generate-mo --quiet
175 - vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium --order-by=random --stop-on-failure
177 - stage: "Documentation"
181 # Mark Codacy coverage final here because all steps of the previous stage did succeed
182 - bash <(curl -Ls https://coverage.codacy.com/get.sh) final
185 - source ~/virtualenv/python3.6/bin/activate
186 - pip install 'Sphinx'
187 script: ./test/ci-docs
189 - stage: "Documentation"
190 name: "Build API docs"
191 before_install: phpenv config-rm xdebug.ini
195 install: composer global require "sami/sami:^4.0"
196 script: $HOME/.composer/vendor/bin/sami.php --no-interaction update ./test/sami-config.php
198 - stage: "Other tests"
199 name: "Build release"
205 - source ~/virtualenv/python3.6/bin/activate
206 - pip install 'Sphinx'
207 script: ./scripts/create-release.sh --ci
209 - stage: "Other tests"
210 name: "Run selenium tests on Google Chrome"
213 - TESTSUITE_SELENIUM_BROWSER=chrome
214 - TESTSUITE_USER=root
215 - TESTSUITE_URL=http://127.0.0.1:8000
216 before_install: phpenv config-rm xdebug.ini
219 - ./test/install-browserstack
220 - composer install --no-interaction
221 - yarn install --non-interactive
222 - echo -e "<?php\n\$cfg['UploadDir'] = './test/test_data/';" > config.inc.php
223 script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug