configure travis
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Родитель
d27336668e
Коммит
d2563ef495
77
.travis.yml
77
.travis.yml
|
@ -3,59 +3,64 @@ dist: trusty
|
|||
language: php
|
||||
php:
|
||||
- 5.6
|
||||
- 7
|
||||
- 7.0
|
||||
- 7.1
|
||||
env:
|
||||
global:
|
||||
- CORE_BRANCH=stable12
|
||||
- CORE_BRANCH=stable13
|
||||
- APP_NAME=sharepoint
|
||||
matrix:
|
||||
- DB=pgsql
|
||||
- DB=sqlite
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- env: DB=pgsql CORE_BRANCH=master
|
||||
- env: DB=sqlite;CODECHECK=2
|
||||
include:
|
||||
- php: 5.6
|
||||
env: DB=sqlite
|
||||
- php: 5.6
|
||||
- php: 7.1
|
||||
env: DB=mysql
|
||||
- php: 7.1
|
||||
env: DB=pgsql CORE_BRANCH=master
|
||||
env: DB=pgsql
|
||||
- php: 7.1
|
||||
env: DB=pgsql CORE_BRANCH=stable13
|
||||
env: DB=sqlite;CORE_BRANCH=stable12
|
||||
- php: 7.1
|
||||
env: DB=sqlite;CODECHECK=1
|
||||
- php: 7.1
|
||||
env: DB=sqlite;CODECHECK=2
|
||||
fast_finish: true
|
||||
|
||||
before_install:
|
||||
# enable a display for running JavaScript tests
|
||||
- export DISPLAY=:99.0
|
||||
- sh -e /etc/init.d/xvfb start
|
||||
- if [[ "$DB" == 'mysql' ]]; then sudo apt-get -y install mariadb-server; fi
|
||||
- nvm install 6
|
||||
- npm install -g npm@latest
|
||||
- make
|
||||
- make appstore
|
||||
# install core
|
||||
- cd ../
|
||||
- git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b $CORE_BRANCH nextcloud
|
||||
- mv sharepoint nextcloud/apps/
|
||||
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
|
||||
- . ./before_install.sh $APP_NAME $CORE_BRANCH $DB
|
||||
|
||||
before_script:
|
||||
- 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 nextcloud
|
||||
- mkdir data
|
||||
- ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass=''
|
||||
- ./occ app:enable sharepoint
|
||||
- php -S localhost:8080 &
|
||||
- cd apps/sharepoint
|
||||
# Add some output debugging information
|
||||
- cd ../server
|
||||
- ./occ check
|
||||
- ./occ status
|
||||
- ./occ app:list
|
||||
- ./occ app:enable files_external # dependency
|
||||
- ./occ app:enable $APP_NAME
|
||||
- ./occ app:list
|
||||
|
||||
script:
|
||||
- make test
|
||||
- cd apps/$APP_NAME/
|
||||
|
||||
# Test the app
|
||||
- sh -c "if [ '$CODECHECK' = '1' ]; then find . -name \*.php -exec php -l \"{}\" \;; fi"
|
||||
- cd ../../
|
||||
- sh -c "if [ '$CODECHECK' = '1' ]; then ./occ app:check-code $APP_NAME -c private -c strong-comparison; fi"
|
||||
- sh -c "if [ '$CODECHECK' = '2' ]; then ./occ app:check-code $APP_NAME -c deprecation; fi"
|
||||
- cd apps/$APP_NAME/
|
||||
|
||||
# Run phpunit tests
|
||||
- cd tests
|
||||
- sh -c "if [ '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then phpunit --configuration phpunit.xml; fi"
|
||||
- cd ..
|
||||
|
||||
# Create coverage report
|
||||
- cd tests
|
||||
- sh -c "if [ '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
|
||||
- sh -c "if [ '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi"
|
||||
- cd ..
|
||||
|
||||
after_failure:
|
||||
- cat ../../data/nextcloud.log
|
||||
|
||||
addons:
|
||||
firefox: "latest"
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<phpunit bootstrap="bootstrap.php"
|
||||
verbose="true"
|
||||
timeoutForSmallTests="900"
|
||||
timeoutForMediumTests="900"
|
||||
timeoutForLargeTests="900"
|
||||
>
|
||||
<testsuite name='Nextcloud - SharePoint Tests'>
|
||||
<directory suffix='Test.php'>.</directory>
|
||||
</testsuite>
|
||||
<!-- filters for code coverage -->
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory suffix=".php">../../sharepoint</directory>
|
||||
<exclude>
|
||||
<directory suffix=".php">../../sharepoint/tests</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
<logging>
|
||||
<!-- and this is where your report will be written -->
|
||||
<log type="coverage-clover" target="./clover.xml"/>
|
||||
<log type="coverage-html" target="./coverage-html"/>
|
||||
</logging>
|
||||
</phpunit>
|
Загрузка…
Ссылка в новой задаче