From 2a346ae76081d59a088b530f9e2bf7344c050168 Mon Sep 17 00:00:00 2001 From: MAXakaWIZARD Date: Sun, 9 Aug 2020 23:44:21 +0300 Subject: [PATCH 1/5] Fix PHP version detection in Travis config --- .travis.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b99503..6911787 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,13 +2,13 @@ language: php matrix: include: - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4snapshot - env: PHP_CS_FIXER_IGNORE_ENV=1 - - php: nightly - env: PHP_CS_FIXER_IGNORE_ENV=1 + - php: 7.1 + - php: 7.2 + - php: 7.3 + - php: 7.4snapshot + env: PHP_CS_FIXER_IGNORE_ENV=1 + - php: nightly + env: PHP_CS_FIXER_IGNORE_ENV=1 fast_finish: true cache: @@ -19,17 +19,17 @@ cache: before_script: - echo $TRAVIS_PHP_VERSION - php -v - - PHP_VERSION=$(php -r "echo PHP_VERSION;") + - PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION ;") - echo $PHP_VERSION - composer install -o -q --no-suggest - if [[ "$PHP_VERSION" == '7.3' ]]; then composer install satooshi/php-coveralls ; fi script: - - make phpcs - - if [[ "$PHP_VERSION" < '8.0' ]]; then make phpstan ; fi - - mkdir -p build/logs - - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then make test-coverage ; fi - - if [[ "$TRAVIS_PHP_VERSION" != '7.3' ]]; then make test ; fi + - make phpcs + - if [[ "$PHP_VERSION" < '8.0' ]]; then make phpstan ; fi + - mkdir -p build/logs + - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then make test-coverage ; fi + - if [[ "$TRAVIS_PHP_VERSION" != '7.3' ]]; then make test ; fi after_script: - - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then php vendor/bin/php-coveralls -v ; fi + - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then php vendor/bin/php-coveralls -v ; fi From 0aabdba54a46ce60051be3bcbc8450afc5dfd656 Mon Sep 17 00:00:00 2001 From: MAXakaWIZARD Date: Sun, 9 Aug 2020 23:46:55 +0300 Subject: [PATCH 2/5] Fix Coveralls installation command --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6911787..cf63aac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ before_script: - PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION ;") - echo $PHP_VERSION - composer install -o -q --no-suggest - - if [[ "$PHP_VERSION" == '7.3' ]]; then composer install satooshi/php-coveralls ; fi + - if [[ "$PHP_VERSION" == '7.3' ]]; then composer require satooshi/php-coveralls ; fi script: - make phpcs From 649d973654fc5e3b211fe6a07dbc96533302aa52 Mon Sep 17 00:00:00 2001 From: MAXakaWIZARD Date: Mon, 10 Aug 2020 00:04:16 +0300 Subject: [PATCH 3/5] Fix build for PHP 8 --- .travis.yml | 7 ++++--- Makefile | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index cf63aac..8e4f645 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,8 +28,9 @@ script: - make phpcs - if [[ "$PHP_VERSION" < '8.0' ]]; then make phpstan ; fi - mkdir -p build/logs - - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then make test-coverage ; fi - - if [[ "$TRAVIS_PHP_VERSION" != '7.3' ]]; then make test ; fi + - if [[ "$PHP_VERSION" < '7.4' ]]; then make test ; fi + - if [[ "$PHP_VERSIONN" == '7.4' ]]; then make test-coverage ; fi + - if [[ "$PHP_VERSION" > '7.4' ]]; then make test-php-8 ; fi after_script: - - if [[ "$TRAVIS_PHP_VERSION" == '7.3' ]]; then php vendor/bin/php-coveralls -v ; fi + - if [[ "$PHP_VERSION" == '7.3' ]]; then php vendor/bin/php-coveralls -v ; fi diff --git a/Makefile b/Makefile index 2cb50bf..7b88f1d 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,11 @@ tools/phpunit: mv tools/phpunit-7.phar tools/phpunit chmod +x tools/phpunit +tools/phpunit-9: + wget --directory-prefix=tools --quiet https://phar.phpunit.de/phpunit-9.phar + mv tools/phpunit-9.phar tools/phpunit + chmod +x tools/phpunit + phpcs: tools/php-cs-fixer composer install --optimize-autoloader --no-dev --no-suggest --quiet tools/php-cs-fixer fix --dry-run --stop-on-violation -v @@ -27,6 +32,10 @@ test: tools/phpunit composer install --optimize-autoloader --no-suggest --quiet tools/phpunit +test-php-8: tools/phpunit-9 + composer install --optimize-autoloader --no-suggest --quiet + tools/phpunit + test-coverage: tools/phpunit composer install --optimize-autoloader --no-suggest --quiet tools/phpunit --coverage-clover build/logs/clover.xml From f151e45eb8ea7872dfb5f9ba7d7b60a0dfb8ec41 Mon Sep 17 00:00:00 2001 From: MAXakaWIZARD Date: Mon, 10 Aug 2020 00:15:09 +0300 Subject: [PATCH 4/5] Fix phpcs for PHP 8 --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 7b88f1d..fd20c7d 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ tools/phpunit-9: chmod +x tools/phpunit phpcs: tools/php-cs-fixer + rm -f .php_cs.cache composer install --optimize-autoloader --no-dev --no-suggest --quiet tools/php-cs-fixer fix --dry-run --stop-on-violation -v From 6be2632e9f36b286cf208d1f2c4d3e00a38281ed Mon Sep 17 00:00:00 2001 From: MAXakaWIZARD Date: Mon, 10 Aug 2020 01:37:15 +0300 Subject: [PATCH 5/5] Fix build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8e4f645..eb9aff6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ before_script: - if [[ "$PHP_VERSION" == '7.3' ]]; then composer require satooshi/php-coveralls ; fi script: - - make phpcs + - if [[ "$PHP_VERSION" < '8.0' ]]; then make phpcs ; fi - if [[ "$PHP_VERSION" < '8.0' ]]; then make phpstan ; fi - mkdir -p build/logs - if [[ "$PHP_VERSION" < '7.4' ]]; then make test ; fi