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/
39 - name: "PHPUnit tests in random order"
42 - stage: "Lint and analyse code"
44 before_install: phpenv config-rm xdebug.ini
51 - yarn run js-lint --quiet
54 - stage: "Lint and analyse code"
56 before_install: phpenv config-rm xdebug.ini
60 script: composer phpstan
62 - stage: "Lint and analyse code"
64 before_install: phpenv config-rm xdebug.ini
68 script: composer psalm
70 - stage: "PHP Unit tests"
75 - stage: "PHP Unit tests"
80 - stage: "PHP Unit tests"
85 - stage: "PHP Unit tests"
89 before_install: phpenv config-rm xdebug.ini
91 - stage: "PHP Unit tests"
96 - composer install --no-interaction --ignore-platform-reqs
98 - yarn install --non-interactive
100 - stage: "PHP Unit tests"
107 - export PATH="/usr/local/opt/gettext/bin:$PATH"
108 - echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini
109 - echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini
112 # Enable password access
113 - mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
122 - stage: "PHP Unit tests"
131 - composer install --no-interaction
132 - yarn install --non-interactive
134 - choco install php composer
135 - choco install mariadb --version=10.4.8
136 - export PATH=/c/tools/php74:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.4"/bin:$PATH
137 - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
138 - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php74/php.ini ; done
139 - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php74/php.ini
140 - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
142 - stage: "PHP Unit tests"
144 name: "PHP 7.1 with dbase extension"
147 - pecl channel-update pecl.php.net
149 - php -m |grep -F 'dbase'
150 - composer install --no-interaction
152 - yarn install --non-interactive
154 - stage: "PHP Unit tests"
156 name: "PHPUnit tests in random order"
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"
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
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"
185 # Mark Codacy coverage final here because all steps of the previous stage did succeed
186 - bash <(curl -Ls https://coverage.codacy.com/get.sh) final
190 - source ~/virtualenv/python3.6/bin/activate
191 - pip install 'Sphinx'
192 script: ./scripts/create-release.sh --ci
194 - stage: "Other tests"
195 name: "Run selenium tests on Google Chrome"
198 - TESTSUITE_SELENIUM_BROWSER=chrome
199 - TESTSUITE_USER=root
200 - TESTSUITE_URL=http://127.0.0.1:8000
201 - TESTSUITE_SERVER="127.0.0.1"
202 - TESTSUITE_DATABASE="selenium"
203 - TESTSUITE_SELENIUM_HOST="127.0.0.1"
204 - TESTSUITE_SELENIUM_PORT="4444"
207 - 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
208 - phpenv config-rm xdebug.ini
209 - cp test/config.e2e.inc.php config.inc.php
211 - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
212 - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
213 - mysql -uroot < sql/create_tables.sql
214 - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
215 - ./test/start-local-server
216 script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug
218 - if [ -f php.log ] ; then cat php.log ; fi
219 - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
220 - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
221 - ./test/stop-local-server
222 - docker logs selenium
223 - docker stop selenium