Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 32 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7

env:
global:
- CORE_BRANCH=master
- APP_NAME=password_policy
matrix:
- DB=sqlite

Expand All @@ -17,29 +15,48 @@ branches:
- master
- /^stable\d+(\.\d+)?$/

sudo: true
before_install:
- wget https://raw.githubusercontent.com/nextcloud/travis_ci/master/before_install.sh
- bash ./before_install.sh password_policy $CORE_BRANCH $DB
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB

script:
# Test lint
# Add some output debugging information
- cd ../server
- cd apps/password_policy
- find . -name \*.php -exec php -l "{}" \;
- ./occ check
- ./occ status
- ./occ app:list
- ./occ app:enable $APP_NAME
- ./occ app:list

script:
# Test the app
- cd apps/$APP_NAME/
- 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
- phpunit --configuration phpunit.xml
- sh -c "if [ '$CODECHECK' != '1' -a '$CODECHECK' != '2' ]; then phpunit --configuration phpunit.xml; fi"
- cd ..

# Create coverage report
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover clover.xml

- 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 ..

matrix:
include:
- php: 5.4
- php: 5.6
env: DB=mysql
- php: 5.4
- php: 5.6
env: DB=pgsql
- php: 5.6
env: DB=mysql;CODECHECK=1
- php: 5.6
env: DB=mysql;CODECHECK=2
allow_failures:
- env: DB=mysql;CODECHECK=2
fast_finish: true