From 54de3da30325056835ec65a46ff0c58f94b20ee5 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 7 Aug 2020 11:25:33 +0100 Subject: [PATCH 1/4] Allow PHP 8 --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c86260b..8e3f6a8 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,8 @@ ], "license": "MIT", "require": { - "php": "^7.3", - "laravel/framework": "^7.0|^8.0", + "php": "^7.3 || ^8.0", + "laravel/framework": "^7.0 || ^8.0", "pestphp/pest": "^0.3" }, "autoload": { @@ -30,7 +30,7 @@ } }, "require-dev": { - "orchestra/testbench": "^5.2|^6.0", + "orchestra/testbench": "^5.2 || ^6.0", "pestphp/pest-dev-tools": "dev-master" }, "minimum-stability": "dev", From 1e7665dca9c703fa746cc9490057457079fe660d Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 7 Aug 2020 11:35:50 +0100 Subject: [PATCH 2/4] Update tests.yml --- .github/workflows/tests.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 99b750c..261254f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,34 +6,36 @@ jobs: ci: runs-on: ${{ matrix.os }} strategy: - fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: [7.3, 7.4] + php: ['7.3', '7.4', '8.0'] dependency-version: [prefer-lowest, prefer-stable] - name: Tests P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} + name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} steps: - - name: Checkout uses: actions/checkout@v2 - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache/files - key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, mbstring, zip + tools: composer:v2 coverage: none - - name: Install Composer dependencies - run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist + - name: Setup Problem Matches + run: | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Install PHP 7 dependencies + run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress + if: "matrix.php < 8" + + - name: Install PHP 8 dependencies + run: composer update --${{ matrix.dependency-version }} --ignore-platform-req=php --no-interaction --no-progress + if: "matrix.php >= 8" - - name: Tests - run: php ./vendor/bin/pest + - name: Unit Tests + run: ./vendor/bin/pest --colors=always From 3702eecbe9e1dbffa7f30e99cdf79c64394ef6f5 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 7 Aug 2020 11:42:32 +0100 Subject: [PATCH 3/4] Update and rename formats.yml to static.yml --- .github/workflows/formats.yml | 46 ----------------------------- .github/workflows/static.yml | 54 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/formats.yml create mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml deleted file mode 100644 index bbdd577..0000000 --- a/.github/workflows/formats.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Formats - -on: ['push', 'pull_request'] - -jobs: - ci: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: true - matrix: - os: [ubuntu-latest] - php: [7.4] - dependency-version: [prefer-lowest, prefer-stable] - - name: Formats P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} - - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache/files - key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, mbstring, zip - tools: prestissimo - coverage: pcov - - - name: Install Composer dependencies - run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist - - - name: Coding Style Checks - run: | - vendor/bin/rector process src --dry-run - vendor/bin/php-cs-fixer fix -v --dry-run - - - name: Type Checks - run: vendor/bin/phpstan analyse --ansi diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..e386061 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,54 @@ +name: Static Analysis + +on: ['push', 'pull_request'] + +jobs: + cs: + runs-on: ubuntu-latest + + name: Code Style + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + tools: composer:v2 + coverage: none + + - name: Install Dependencies + run: composer update --no-interaction --no-progress + + - name: Run Rector + run: vendor/bin/rector process src --dry-run + + - name: Run PHP-CS-Fixer + run: vendor/bin/php-cs-fixer fix -v --allow-risky=yes --dry-run + + phpstan: + runs-on: ubuntu-latest + strategy: + matrix: + dependency-version: [prefer-lowest, prefer-stable] + + name: PHPStan ${{ matrix.dependency-version }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + tools: composer:v2 + coverage: none + + - name: Install Dependencies + run: composer update --prefer-stable --no-interaction --no-progress + + - name: Run PHPStan + run: vendor/bin/phpstan analyse --no-progress From a5d151e12683a8137ebcd83eac6cf60123ec0646 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Fri, 7 Aug 2020 11:55:58 +0100 Subject: [PATCH 4/4] Update rector.yaml --- rector.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rector.yaml b/rector.yaml index 317a9e8..bf3cd02 100644 --- a/rector.yaml +++ b/rector.yaml @@ -3,12 +3,16 @@ parameters: sets: - 'action-injection-to-constructor-injection' - 'array-str-functions-to-static-call' - - 'celebrity' - 'phpstan' - 'phpunit-code-quality' - 'solid' - 'doctrine-code-quality' - 'code-quality' + - 'php53' + - 'php54' + - 'php55' + - 'php56' + - 'php70' - 'php71' - 'php72' - 'php73'