2c14c38030
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
92 lines
2.2 KiB
YAML
92 lines
2.2 KiB
YAML
dist: trusty
|
|
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- mysql-server-5.6
|
|
- mysql-client-core-5.6
|
|
- mysql-client-5.6
|
|
- libxml2-utils
|
|
|
|
branches:
|
|
only:
|
|
- master
|
|
- /^stable\d+(\.\d+)?$/
|
|
|
|
cache:
|
|
directories:
|
|
- "$HOME/.composer/cache/files"
|
|
- "$HOME/.npm"
|
|
|
|
|
|
env:
|
|
global:
|
|
- CORE_BRANCH=master
|
|
- PHP_COVERAGE=FALSE
|
|
- DB=mysql
|
|
|
|
before_install:
|
|
- php --info
|
|
|
|
# Set up DB
|
|
- if [[ "$DB" == 'pgsql' ]]; then createuser -U travis -s oc_autotest; fi
|
|
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e 'create database oc_autotest;'; fi
|
|
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"; fi
|
|
- if [[ "$DB" == 'mysql' ]]; then mysql -u root -e "GRANT ALL ON oc_autotest.* TO 'oc_autotest'@'localhost';"; fi
|
|
- cd ..
|
|
- git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH core
|
|
- mv tasks core/apps/
|
|
|
|
before_script:
|
|
# Set up core
|
|
- php -f core/occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass=''
|
|
|
|
# Set up app
|
|
- php -f core/occ app:enable tasks
|
|
|
|
# Enable app twice to check occ errors of registered commands
|
|
- php -f core/occ app:enable tasks
|
|
- cd core/apps/tasks
|
|
|
|
# Run JS tests
|
|
- npm install -g npm@latest
|
|
- make dev-setup
|
|
|
|
# XDebug is only needed if we report coverage -> speeds up other builds
|
|
- if [[ "$PHP_COVERAGE" = "FALSE" ]];
|
|
then phpenv config-rm xdebug.ini;
|
|
fi
|
|
|
|
script:
|
|
# Check info.xml schema validity
|
|
- wget https://apps.nextcloud.com/schema/apps/info.xsd
|
|
- xmllint appinfo/info.xml --schema info.xsd --noout
|
|
- rm info.xsd
|
|
|
|
# Run server's app code checker
|
|
- php ../../occ app:check-code tasks
|
|
|
|
# Test php
|
|
- make test-php
|
|
- if [[ "$PHP_COVERAGE" = "TRUE" ]];
|
|
then make test-php-coverage;
|
|
else make test-php;
|
|
fi
|
|
|
|
after_success:
|
|
- if [[ "$PHP_COVERAGE" = "TRUE" ]];
|
|
then bash <(curl -s https://codecov.io/bash) -cF php;
|
|
fi
|
|
|
|
after_failure:
|
|
- cat ../../data/nextcloud.log
|
|
|
|
matrix:
|
|
include:
|
|
- language: php
|
|
php: 7.2
|
|
|
|
- language: php
|
|
php: 7.3
|
|
env: "DB=mysql CORE_BRANCH=master PHP_COVERAGE=TRUE"
|
|
fast_finish: true
|