passman/.travis.yml
2016-10-09 13:29:05 +02:00

98 lines
No EOL
3.3 KiB
YAML

language: php
php:
- 5.6
- 7
env:
global:
- CORE_BRANCH=master
- APP_NAME=passman
matrix:
- DB=mysql
branches:
only:
- master
#matrix:
# allow_failures:
# - env: DB=pgsql CORE_BRANCH=master
# include:
# - php: 5.6
# env: DB=sqlite
# - php: 5.6
# env: DB=mysql
# - php: 5.6
# env: DB=pgsql CORE_BRANCH=master
# 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
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
# Add some output debugging information
- cd ../server
- ./occ check
- ./occ status
- ./occ app:list
- nvm install 5.9
- npm install -g npm@latest
- sh -c "if [ '$JSTESTS' = '1' ]; then npm install grunt-cli -g; fi"
#
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
- ./occ app:enable passman
- php -S localhost:8080 &
- cd apps/$APP_NAME/
- mkdir -p build
- curl -sSL https://phar.phpunit.de/phpunit.phar -o build/phpunit.phar
- sh -c "if [ '$JSTESTS' = '1' ]; then npm install; fi"
# - ./occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database $DB --database-pass=''
script:
# Test the app
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '1' ]; then find . -name \*.php -exec php -l \"{}\" \;; fi"
- cd ../../
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '1' ]; then ./occ app:check-code $APP_NAME -c private -c strong-comparison; fi"
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' = '2' ]; then ./occ app:check-code $APP_NAME -c deprecation; fi"
- cd apps/$APP_NAME/
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php build/phpunit.phar -c phpunit.xml --coverage-clover=coverage.clover; fi"
# Create coverage report
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
- sh -c "if [ '$JSTESTS' != '1' -a '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi"
#- cd ../
- sh -c "if [ '$JSTESTS' = '1' ]; then grunt jshint; fi"
#after_failure:
# - cat ../../data/owncloud.log
addons:
firefox: "latest"
matrix:
include:
- php: 5.6
env: DB=mysql
- php: 5.6
env: DB=pgsql
- php: 5.6
env: DB=mysql;CODECHECK=1
- php: 5.6
env: DB=mysql;JSTESTS=1;
- php: 7.0
env: DB=mysql;CODECHECK=1
- php: 5.6
env: DB=mysql;CODECHECK=2
- php: 7.0
env: DB=mysql;CODECHECK=2
allow_failures:
- env: DB=mysql;CODECHECK=2