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 - bash <(curl -s https://codecov.io/bash)
22 - 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
23 - 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
32 - $HOME/.composer/cache/
40 - name: "PHPUnit tests in random order"
43 - stage: "Lint and analyse code"
45 before_install: phpenv config-rm xdebug.ini
52 - yarn run js-lint --quiet
55 - stage: "Lint and analyse code"
57 before_install: phpenv config-rm xdebug.ini
61 script: composer phpstan
63 - stage: "Lint and analyse code"
65 before_install: phpenv config-rm xdebug.ini
69 script: composer psalm
71 - stage: "PHP Unit tests"
76 - stage: "PHP Unit tests"
81 - stage: "PHP Unit tests"
86 - stage: "PHP Unit tests"
90 before_install: phpenv config-rm xdebug.ini
92 - stage: "PHP Unit tests"
97 - composer install --no-interaction --ignore-platform-reqs
99 - yarn install --non-interactive
101 - stage: "PHP Unit tests"
108 - export PATH="/usr/local/opt/gettext/bin:$PATH"
109 - echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
110 - echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
113 # Enable password access
114 - mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
123 - stage: "PHP Unit tests"
132 - composer install --no-interaction
133 - yarn install --non-interactive
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"
145 name: "PHP 7.1 with dbase extension"
148 - pecl channel-update pecl.php.net
150 - php -m |grep -F 'dbase'
151 - composer install --no-interaction
153 - yarn install --non-interactive
155 - stage: "PHP Unit tests"
157 name: "PHPUnit tests in random order"
160 - scripts/generate-mo --quiet
161 - vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium --order-by=random --stop-on-failure
163 - stage: "Documentation"
169 - source ~/virtualenv/python3.6/bin/activate
170 - pip install 'Sphinx'
171 script: ./test/ci-docs
173 - stage: "Documentation"
174 name: "Build API docs"
175 before_install: phpenv config-rm xdebug.ini
179 install: composer global require "sami/sami:^4.0"
180 script: $HOME/.composer/vendor/bin/sami.php --no-interaction update ./test/sami-config.php
182 - stage: "Other tests"
183 name: "Build release"
186 # Mark Codacy coverage final here because all steps of the previous stage did succeed
187 - bash <(curl -Ls https://coverage.codacy.com/get.sh) final
191 - source ~/virtualenv/python3.6/bin/activate
192 - pip install 'Sphinx'
193 script: ./scripts/create-release.sh --ci
195 - stage: "Other tests"
196 name: "Run selenium tests on Google Chrome"
199 - TESTSUITE_SELENIUM_BROWSER=chrome
200 - TESTSUITE_USER=root
201 - TESTSUITE_URL=http://127.0.0.1:8000
202 - TESTSUITE_SERVER="127.0.0.1"
203 - TESTSUITE_DATABASE="selenium"
205 - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
206 - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
207 - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
208 - mysql -uroot < sql/create_tables.sql
209 - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
210 - ./test/start-local-server
211 script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug
213 - if [ -f php.log ] ; then cat php.log ; fi
214 - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
215 - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
216 - ~/browserstack/BrowserStackLocal --daemon stop
218 - phpenv config-rm xdebug.ini
219 - ./test/install-browserstack
220 - cp test/config.e2e.inc.php config.inc.php