diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index acccdb5b..ff3dfdee 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - php: [5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4] + php: [5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0] stability: [prefer-stable] steps: @@ -40,7 +40,11 @@ jobs: env: CI_PHP_VERSION: ${{ matrix.php }} run: | - composer install --no-interaction --no-progress + if [[ ${CI_PHP_VERSION:0:1} == "8" ]]; then + composer install --no-interaction --no-progress --ignore-platform-reqs + else + composer install --no-interaction --no-progress + fi if [[ ${CI_PHP_VERSION:0:3} == "7.1" ]]; then # 1) delete sebastian dependency hell composer remove phpunit/phpunit --dev --no-interaction && composer remove sebastian/phpcpd --no-interaction; @@ -51,18 +55,58 @@ jobs: # 4) install suggested tools bin/suggested-tools.sh install; fi + if [ ${CI_PHP_VERSION:0:3} == "7.4" ] || [ ${CI_PHP_VERSION:0:1} == "8" ]; then + # 1) delete sebastian dependency hell + composer remove phpunit/phpunit --dev --no-interaction && composer remove sebastian/phpcpd --no-interaction; + # 2) update tools + composer update; + # 3) reinstall latest versions TODO: phpcpd v6 + composer require phpunit/phpunit --dev; + # 4) install suggested tools + bin/suggested-tools.sh install; + # 5) fix new php versions + php tests/.phpunit/fix-typehints.php + fi # test installing suggested tools like docker image if [[ ${CI_PHP_VERSION:0:3} == "7.2" ]]; then bin/suggested-tools.sh install --prefer-dist; fi + echo + + - name: Show versions + env: + CI_PHP_VERSION: ${{ matrix.php }} + run: | + composer outdated --direct --all + if [[ ${CI_PHP_VERSION:0:3} == "8" ]]; then + # TODO: enable phpqa when robo v2 is supported + echo "Old robo causes fatal errors on php8..." + else + ./phpqa tools + fi - name: Run tests + env: + CI_PHP_VERSION: ${{ matrix.php }} run: | vendor/phpunit/phpunit/phpunit - ./phpqa tools - bin/ci.sh + if [[ ${CI_PHP_VERSION:0:3} == "7.4" ]]; then + # TODO: revert when phpcpd v6 is supported + ./phpqa --config tests/.ci --tools "phpmetrics:0,phploc,phpcs:0,php-cs-fixer,phpmd:0,pdepend,phpcpd,phpstan,phpunit:0,psalm,security-checker,parallel-lint:0" + elif [[ ${CI_PHP_VERSION:0:3} == "8" ]]; then + # TODO: enable phpqa when robo v2 is supported + mkdir -p build + else + bin/ci.sh + fi ls -lAh build + - name: Upload QA files + uses: actions/upload-artifact@v2 + with: + name: phpqa-${{ matrix.php }} + path: build + # DEPRECATED TRAVIS #deploy: # - provider: script diff --git a/README.md b/README.md index 5c3214bc..b2f4bd9a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Analyze PHP code with one command. [![License](https://poser.pugx.org/edgedesign/phpqa/license)](https://packagist.org/packages/edgedesign/phpqa) [![Latest Stable Version](https://poser.pugx.org/edgedesign/phpqa/v/stable)](/CHANGELOG.md) [![Total Downloads](https://poser.pugx.org/edgedesign/phpqa/downloads)](https://packagist.org/packages/edgedesign/phpqa) +[![Build Status](https://github.com/EdgedesignCZ/phpqa/workflows/PHPQA%20CI/badge.svg?branch=master)](https://github.com/EdgedesignCZ/phpqa/actions) [![Windows status](https://ci.appveyor.com/api/projects/status/t9f05uk4cjcg294o?svg=true&passingText=Windows)](https://ci.appveyor.com/project/zdenekdrahos/phpqa) ## Requirements diff --git a/appveyor.yml b/appveyor.yml index 7f20e2a2..4327f0b8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,6 +4,7 @@ environment: matrix: - php_version: 7.2.20 +skip_branch_with_pr: true branches: except: - gh-pages diff --git a/composer.json b/composer.json index 042b0a82..38312a69 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "jakub-onderka/php-console-highlighter": "Colored output in parallel-lint" }, "require-dev": { - "hamcrest/hamcrest-php": "*", + "hamcrest/hamcrest-php": ">=2.0.1", "phpunit/phpunit": "~4.8.28" }, "autoload": { @@ -54,7 +54,7 @@ }, "autoload-dev": { "files": [ - "tests/phpunit-compatibility.php", + "tests/.phpunit/fix-testcase.php", "vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php" ] }, diff --git a/composer.lock b/composer.lock index 9dc49fbf..7631aea0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "92055fab58f1b19a77087744923c8585", + "content-hash": "a60c62c4d611b18bb75af69f32687fda", "packages": [ { "name": "consolidation/robo", @@ -1036,6 +1036,7 @@ ], "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", "homepage": "https://github.com/sebastianbergmann/finder-facade", + "abandoned": true, "time": "2016-02-17T07:02:23+00:00" }, { @@ -1961,20 +1962,20 @@ }, { "name": "hamcrest/hamcrest-php", - "version": "v2.0.0", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad" + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", "shasum": "" }, "require": { - "php": "^5.3|^7.0" + "php": "^5.3|^7.0|^8.0" }, "replace": { "cordoval/hamcrest-php": "*", @@ -1982,14 +1983,13 @@ "kodova/hamcrest-php": "*" }, "require-dev": { - "phpunit/php-file-iterator": "1.3.3", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "^1.0" + "phpunit/php-file-iterator": "^1.4 || ^2.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -1999,13 +1999,13 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD" + "BSD-3-Clause" ], "description": "This is the PHP port of Hamcrest Matchers", "keywords": [ "test" ], - "time": "2016-01-20T08:20:44+00:00" + "time": "2020-07-09T08:09:16+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -2316,6 +2316,7 @@ "keywords": [ "tokenizer" ], + "abandoned": true, "time": "2017-12-04T08:55:13+00:00" }, { diff --git a/tests/phpunit-compatibility.php b/tests/.phpunit/fix-testcase.php similarity index 100% rename from tests/phpunit-compatibility.php rename to tests/.phpunit/fix-testcase.php diff --git a/tests/.phpunit/fix-typehints.php b/tests/.phpunit/fix-typehints.php new file mode 100644 index 00000000..fbeac93b --- /dev/null +++ b/tests/.phpunit/fix-typehints.php @@ -0,0 +1,21 @@ +