diff --git a/.travis.yml b/.travis.yml index 3b81e04..a2ee62c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,80 @@ +sudo: false + language: php -php: - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - hhvm +cache: + directories: + - $HOME/.composer/cache + +env: + global: + - COMPOSER_ARGS="--no-interaction" + - COVERAGE_DEPS="satooshi/php-coveralls" + - LEGACY_DEPS="phpunit/phpunit" + +matrix: + include: + - php: 5.6 + env: + - DEPS=lowest + - php: 5.6 + env: + - DEPS=locked + - TEST_COVERAGE=true + - php: 5.6 + env: + - DEPS=latest + - php: 7 + env: + - DEPS=lowest + - php: 7 + env: + - DEPS=locked + - CS_CHECK=true + - php: 7 + env: + - DEPS=latest + - php: 7.1 + env: + - DEPS=lowest + - php: 7.1 + env: + - DEPS=locked + - php: 7.1 + env: + - DEPS=latest + - php: nightly + env: + - DEPS=lowest + - php: nightly + env: + - DEPS=locked + - php: nightly + env: + - DEPS=latest + allow_failures: + - php: nightly before_install: - - composer install + - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi + - travis_retry composer self-update + +install: + - travis_retry composer install $COMPOSER_ARGS + - if [[ $TRAVIS_PHP_VERSION =~ ^5.6 ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi + - if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi + - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi + - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi + - stty cols 120 + - export COLUMNS=120 + - composer show script: - - ./vendor/bin/phpunit + - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi + - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi + +after_script: + - if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi notifications: - irc: "irc.freenode.org#zftalk.2" + email: false diff --git a/composer.json b/composer.json index ec4282e..df479be 100644 --- a/composer.json +++ b/composer.json @@ -1,16 +1,33 @@ { "name": "zendframework/zendservice-google-gcm", "description": "OOP wrapper for Google Cloud Messaging", - "type": "library", + "homepage": "https://github.com/zendframework/zendservice-google-gcm", + "license": "BSD-3-Clause", "keywords": [ "zf2", "gcm", "push", "notification", - "google" + "google", + "zend", + "zendframework", + "zf3" ], - "homepage": "https://github.com/zendframework/zendservice-google-gcm", - "license": "BSD-3-Clause", + "support": { + "issues": "https://github.com/zendframework/zendservice-google-gcm/issues", + "source": "https://github.com/zendframework/zendservice-google-gcm", + "rss": "https://github.com/zendframework/zendservice-google-gcm/releases.atom", + "slack": "https://zendframework-slack.herokuapp.com" + }, + "require": { + "php": "^5.5 || ^7.0", + "zendframework/zend-http": "^2.0|^3.0", + "zendframework/zend-json": "^2.0|^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "zendframework/zend-coding-standard": "~1.0.0" + }, "autoload": { "psr-4": { "ZendService\\Google\\": "library/" @@ -21,12 +38,18 @@ "ZendServiceTest\\Google\\": "tests/" } }, - "require": { - "php": "^5.5 || ^7.0", - "zendframework/zend-http": "^2.0", - "zendframework/zend-json": "^2.0" + "config": { + "sort-packages": true }, - "require-dev": { - "phpunit/PHPUnit": "^4.8" + "scripts": { + "check": [ + "@cs-check", + "@test" + ], + "cs-check": "phpcs ./library", + "cs-fix": "phpcbf", + "test": "phpunit --colors=always", + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml", + "upload-coverage": "coveralls -v" } }