2 # - run testsuite for every PHP version
3 # - run lint for every PHP version
4 # - run Selenium for single PHP version
16 - if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then source ~/virtualenv/python3.6/bin/activate ; fi
17 - ./test/ci-install-$CI_MODE
18 - if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then case "$TRAVIS_PHP_VERSION" in hhvm*) ;; *) phpenv config-add test/php-noprofile.ini ;; esac ; fi
21 - export TESTSUITE_PASSWORD=`openssl rand -base64 30`
22 - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode`
23 - export PATH=~/.composer/vendor/bin/:$PATH
24 - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test"
25 - mysql -uroot < sql/create_tables.sql
26 - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')"
27 - ./test/start-local-server
30 - ./scripts/generate-mo --quiet
31 - if [ $CI_MODE = test ] ; then ./test/ci-phplint ; fi
35 - if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi
36 - if [ -f php.log ] ; then cat php.log ; fi
37 - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi
38 - if [ -f build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; fi
39 - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi
40 - if [ "$CI_MODE" = "selenium" ] ; then ~/browserstack/BrowserStackLocal --daemon stop; fi
43 - bash <(curl -s https://codecov.io/bash)
46 - name: "PHP Unit tests"
47 - name: "Lint and analyse code"
48 - name: "Documentation"
53 - stage: "Lint and analyse code"
54 name: "Lint PHP files"
57 - stage: "Lint and analyse code"
61 - stage: "Documentation"
65 - stage: "Documentation"
66 name: "Build API docs"
69 - stage: "PHP Unit tests"
76 - brew install openldap libiconv php@7.2 composer mariadb yarn
77 - brew link --force gettext
78 - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /usr/local/etc/php/7.2/php.ini
80 - stage: "PHP Unit tests"
84 - stage: "PHP Unit tests"
88 - stage: "PHP Unit tests"
92 - stage: "PHP Unit tests"
96 - stage: "PHP Unit tests"
102 - choco install php composer mariadb
103 - export PATH=/c/tools/php72:/c/ProgramData/ComposerSetup/bin:/c/"Program Files"/"MariaDB 10.2"/bin:$PATH
104 - PHP_EXTENSIONS="mysqli curl bz2 gd2 pdo_mysql"
105 - for php_ext in $PHP_EXTENSIONS ; do sed -i -e "s/^;extension=${php_ext}/extension=${php_ext}/" /c/tools/php72/php.ini ; done
106 - sed -i -e 's/^memory_limit = .*/memory_limit = -1/' /c/tools/php72/php.ini
107 - find . -type f -name "*.php" -print0 | xargs -0 sed -i ':a;N;$!ba;s/\r//g'
108 - stage: "Other tests"
109 name: "Build release"
112 - stage: "Other tests"
113 name: "Run selenium tests on Google Chrome"
117 - TESTSUITE_SELENIUM_BROWSER=chrome
118 - TESTSUITE_USER=root
119 - TESTSUITE_URL=http://127.0.0.1:8000
131 - $HOME/.composer/cache/
134 # Install APT packages
135 # - git > 2.5.1 needed for worktrees
136 # - mysql server does not seem to be always present on Travis Trusty environment