rhosocial/yii2-organization

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
language: php
php:
    - 5.6
    - 7.0
    - 7.1
    - nightly

sudo: required
matrix:
    allow_failures:
        - php: nightly
        
branches:
    except:
        - gh-pages
        
services:
    - mysql

env:
    - DB=mysql
    
cache:
    directories:
        - vendor
        - $HOME/.composer/cache

install:
    - echo $TRAVIS_PHP_VERSION
    - travis_retry composer self-update && composer --version
    - travis_retry composer global require "fxp/composer-asset-plugin:*"
    - php -r "echo INTL_ICU_VERSION . \"\n\";"
    - php -r "echo INTL_ICU_DATA_VERSION . \"\n\";"
    - php -v
    - |
        if [ $TRAVIS_PHP_VERSION != 'hhvm' ]; then
            php -m
        fi
    - export PATH="$HOME/.composer/vendor/bin/:$PATH"
    - travis_retry composer update --prefer-dist --no-interaction
    - sudo chmod +x yii
    
before_script:
    - mysql --version
    - mysql -uroot < tests/data/rhosocial_yii2_user.sql
    - phpenv config-add tests/data/php.ini
    - ./yii migrate --migrationPath=@rhosocial/user --migrationNamespaces=rhosocial\\user\\migrations --interactive=0
    - ./yii migrate --migrationPath=@rhosocial/user --migrationNamespaces=rhosocial\\user\\rbac\\migrations --interactive=0
    - ./yii migrate --migrationPath=@rhosocial/user --migrationNamespaces=rhosocial\\user\\models\\log\\migrations --interactive=0
    - ./yii migrate --migrationPath=@rhosocial/organization --migrationNamespaces=rhosocial\\organization\\migrations --interactive=0
    - ./yii migrate --migrationPath=@rhosocial/organization --migrationNamespaces=rhosocial\\organization\\rbac\\migrations --interactive=0
    - |
        if [ $TRAVIS_PHP_VERSION = 'nightly' ]; then
            travis_retry wget https://phar.phpunit.de/phpunit-5.7.phar
            mv phpunit-5.7.phar phpunit.phar
            chmod +x phpunit.phar
            EXCLUDE_FLAGS="--exclude-group mongo"
        elif [ $TRAVIS_PHP_VERSION = '7.1' ]; then
            travis_retry wget https://phar.phpunit.de/phpunit-5.7.phar
            mv phpunit-5.7.phar phpunit.phar
            chmod +x phpunit.phar
            EXCLUDE_FLAGS="--exclude-group mongo"
        elif [ $TRAVIS_PHP_VERSION = '7.0' ]; then
            travis_retry wget https://phar.phpunit.de/phpunit-5.7.phar
            mv phpunit-5.7.phar phpunit.phar
            chmod +x phpunit.phar
            EXCLUDE_FLAGS="--exclude-group mongo"
        elif [ $TRAVIS_PHP_VERSION = '5.6' ]; then
            travis_retry wget https://phar.phpunit.de/phpunit-5.7.phar
            mv phpunit-5.7.phar phpunit.phar
            chmod +x phpunit.phar
            PHPUNIT_FLAGS="--coverage-clover=coverage.clover"
        fi
        
script: 
    - |
        if [ $TRAVIS_PHP_VERSION = 'nightly' ] || [ $TRAVIS_PHP_VERSION = '7.1' ] || [ $TRAVIS_PHP_VERSION = '7.0' ]; then
            php phpunit.phar --verbose $EXCLUDE_FLAGS
        elif [ $TRAVIS_PHP_VERSION = '5.6' ]; then
            php phpunit.phar --verbose $PHPUNIT_FLAGS
        else
            phpunit --verbose
        fi
        
after_script:
  - |
    if [ $TRAVIS_PHP_VERSION = '5.6' ]; then
      travis_retry wget https://scrutinizer-ci.com/ocular.phar
      php ocular.phar code-coverage:upload --format=php-clover coverage.clover
    fi