dist: xenial language: php stages: - name: "Lint and analyse code" - name: "PHP Unit tests" - name: "Documentation" - name: "Other tests" install: - composer install --no-interaction - yarn install --non-interactive before_script: - export TESTSUITE_PASSWORD=`openssl rand -base64 30` - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode` - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test" - mysql -uroot < sql/create_tables.sql - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')" - ./test/start-local-server script: - ./scripts/generate-mo --quiet - ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium after_script: - if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi - if [ -f php.log ] ; then cat php.log ; fi - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi - if [ -f build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; fi - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi - if [ "$CI_MODE" = "selenium" ] ; then ~/browserstack/BrowserStackLocal --daemon stop; fi after_success: bash <(curl -s https://codecov.io/bash) services: - mysql cache: pip: true yarn: true directories: - $HOME/.composer/cache/ - $HOME/browserstack - node_modules jobs: allow_failures: - php: nightly - os: osx - name: "PHP 7.1 with dbase extension" - name: "PHP 7.4" include: - stage: "Lint and analyse code" name: "Lint files" before_script: skip after_script: skip after_success: skip script: - ./test/ci-phplint - composer phpcs - yarn run js-lint --quiet - yarn run css-lint - stage: "Lint and analyse code" name: "Run phpstan" before_script: skip after_script: skip after_success: skip script: composer phpstan - stage: "PHP Unit tests" php: 7.1 name: "PHP 7.1" env: CI_MODE=test - stage: "PHP Unit tests" php: 7.2 name: "PHP 7.2" env: CI_MODE=test - stage: "PHP Unit tests" php: 7.3 name: "PHP 7.3" env: CI_MODE=test - stage: "PHP Unit tests" php: 7.4snapshot name: "PHP 7.4" env: CI_MODE=test - stage: "PHP Unit tests" php: nightly name: "PHP nightly" env: CI_MODE=test install: - composer install --no-interaction --ignore-platform-reqs - yarn install --non-interactive - stage: "PHP Unit tests" name: "OSX" os: osx env: CI_MODE=test language: node_js node_js: 10 before_install: - brew link --force gettext - echo "memory_limit=-1" > /usr/local/etc/php/7.3/conf.d/50-travis.ini - echo "pcre.jit=0" >> /usr/local/etc/php/7.3/conf.d/50-travis.ini - mysql.server start addons: homebrew: packages: - php - composer - mariadb update: true - stage: "PHP Unit tests" name: "Windows" os: windows language: node_js node_js: 10 env: - CI_MODE=test - YARN_GPG=no before_install: - choco install php composer mariadb - export PATH=/c/tools/php73:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.4"/bin:$PATH - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql" - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php73/php.ini ; done - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php73/php.ini - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g' - stage: "PHP Unit tests" php: 7.1 name: "PHP 7.1 with dbase extension" env: CI_MODE=test install: - pecl channel-update pecl.php.net - pecl install dbase-7.0.0beta1 - composer install --no-interaction - yarn install --non-interactive - stage: "Documentation" name: "Build docs" before_script: skip after_script: skip after_success: skip install: - source ~/virtualenv/python3.6/bin/activate - pip install 'Sphinx' script: ./test/ci-docs - stage: "Documentation" name: "Build API docs" before_script: skip after_script: skip after_success: skip install: composer global require "sami/sami:^4.0" script: $HOME/.composer/vendor/bin/sami.php --no-interaction update ./test/sami-config.php - stage: "Other tests" name: "Build release" before_script: skip after_script: skip after_success: skip install: - source ~/virtualenv/python3.6/bin/activate - pip install 'Sphinx' script: ./scripts/create-release.sh --ci - stage: "Other tests" name: "Run selenium tests on Google Chrome" env: - CI_MODE=selenium - TESTSUITE_SELENIUM_BROWSER=chrome - TESTSUITE_USER=root - TESTSUITE_URL=http://127.0.0.1:8000 install: - ./test/install-browserstack - composer install --no-interaction - yarn install --non-interactive - echo -e " config.inc.php script: ./vendor/bin/phpunit --configuration phpunit.xml.nocoverage --group selenium --verbose --debug addons: apt: packages: - nginx