From fcaa9028d80a38394cf92dd3f6c30d3a47146e8d Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Thu, 28 Mar 2024 10:05:19 +0100 Subject: [PATCH] Support Laravel 11 --- .github/workflows/autoformat.yml | 8 ++-- .github/workflows/validate.yml | 69 ++++++++++++++++++++------------ .gitignore | 5 ++- composer.json | 11 ++--- 4 files changed, 54 insertions(+), 39 deletions(-) diff --git a/.github/workflows/autoformat.yml b/.github/workflows/autoformat.yml index 748fed1..4f1e074 100644 --- a/.github/workflows/autoformat.yml +++ b/.github/workflows/autoformat.yml @@ -1,4 +1,4 @@ -name: "Autoformat" +name: Autoformat on: push: @@ -6,13 +6,13 @@ jobs: composer-normalize: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - uses: shivammathur/setup-php@v2 - - uses: ramsey/composer-install@v2 + - uses: ramsey/composer-install@v3 - run: composer normalize @@ -23,7 +23,7 @@ jobs: prettier: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c39771a..1697c27 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -23,7 +23,9 @@ jobs: - 8.0 - 8.1 - 8.2 + - 8.3 laravel-version: + - 5.5.* - 5.6.* - 5.7.* - 5.8.* @@ -32,6 +34,7 @@ jobs: - ^8 - ^9 - ^10 + - ^11 exclude: - php-version: 7.1 laravel-version: ^6 @@ -43,20 +46,30 @@ jobs: laravel-version: ^9 - php-version: 7.1 laravel-version: ^10 + - php-version: 7.1 + laravel-version: ^11 - php-version: 7.2 laravel-version: ^8 - php-version: 7.2 laravel-version: ^9 - php-version: 7.2 laravel-version: ^10 + - php-version: 7.2 + laravel-version: ^11 - php-version: 7.3 laravel-version: ^9 - php-version: 7.3 laravel-version: ^10 + - php-version: 7.3 + laravel-version: ^11 - php-version: 7.4 laravel-version: ^9 - php-version: 7.4 laravel-version: ^10 + - php-version: 7.4 + laravel-version: ^11 + - php-version: 8.0 + laravel-version: 5.5.* - php-version: 8.0 laravel-version: 5.6.* - php-version: 8.0 @@ -69,6 +82,10 @@ jobs: laravel-version: ^7 - php-version: 8.0 laravel-version: ^10 + - php-version: 8.0 + laravel-version: ^11 + - php-version: 8.1 + laravel-version: 5.5.* - php-version: 8.1 laravel-version: 5.6.* - php-version: 8.1 @@ -79,6 +96,10 @@ jobs: laravel-version: ^6 - php-version: 8.1 laravel-version: ^7 + - php-version: 8.1 + laravel-version: ^11 + - php-version: 8.2 + laravel-version: 5.5.* - php-version: 8.2 laravel-version: 5.6.* - php-version: 8.2 @@ -89,54 +110,50 @@ jobs: laravel-version: ^6 - php-version: 8.2 laravel-version: ^7 + - php-version: 8.3 + laravel-version: 5.5.* + - php-version: 8.3 + laravel-version: 5.6.* + - php-version: 8.3 + laravel-version: 5.7.* + - php-version: 8.3 + laravel-version: 5.8.* + - php-version: 8.3 + laravel-version: ^6 + - php-version: 8.3 + laravel-version: ^7 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }} php-version: ${{ matrix.php-version }} - - uses: actions/cache@v1 - with: - path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }} - restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}- - - run: composer require illuminate/support:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress - - run: vendor/bin/phpunit --colors=always + - if: matrix.laravel-version == ^11 + run: vendor/bin/phpunit --coverage-filter=src + - if: matrix.laravel-version != ^11 + run: vendor/bin/phpunit coverage: runs-on: ubuntu-20.04 - strategy: - matrix: - php-version: - - 8.1 - laravel-version: - - ^9 - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: coverage: pcov extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }} - php-version: ${{ matrix.php-version }} + php-version: 8.3 - - uses: actions/cache@v1 - with: - path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }} - restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}- - - - run: composer require illuminate/support:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress + - uses: ramsey/composer-install@v3 - - run: vendor/bin/phpunit --coverage-clover=coverage.xml + - run: vendor/bin/phpunit --coverage-clover=coverage.xml --coverage-filter=src - - uses: codecov/codecov-action@v2 + - uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 256ae4e..1295fd1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -vendor -composer.lock .DS_Store .idea/ +.phpunit.result.cache +composer.lock +vendor diff --git a/composer.json b/composer.json index 120db20..2adff51 100644 --- a/composer.json +++ b/composer.json @@ -19,14 +19,14 @@ "homepage": "https://github.com/mll-lab/laravel-comment", "require": { "php": "^7.1 || ^8", - "illuminate/contracts": "~5.5.0 || ~5.6.0 || ~5.7.0 || ~5.8.0 || ^6 || ^7 || ^8 || ^9 || ^10", - "illuminate/support": "~5.5.0 || ~5.6.0 || ~5.7.0 || ~5.8.0 || ^6 || ^7 || ^8 || ^9 || ^10" + "illuminate/contracts": "~5.5.0 || ~5.6.0 || ~5.7.0 || ~5.8.0 || ^6 || ^7 || ^8 || ^9 || ^10 || ^11", + "illuminate/support": "~5.5.0 || ~5.6.0 || ~5.7.0 || ~5.8.0 || ^6 || ^7 || ^8 || ^9 || ^10 || ^11" }, "require-dev": { "ergebnis/composer-normalize": "^2", "fakerphp/faker": "^1.8", - "orchestra/testbench": "~3.5.0 || ~3.6.0 || ~3.7.0 || ~3.8.0 || ~3.9.0 || ^4 || ^5 || ^6 || ^7 || ^8", - "phpunit/phpunit": "^7.5 || ^8.4 || ^9 || ^10" + "orchestra/testbench": "~3.5.0 || ~3.6.0 || ~3.7.0 || ~3.8.0 || ~3.9.0 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9", + "phpunit/phpunit": "^7.5 || ^8.4 || ^9 || ^10 || ^11" }, "autoload": { "psr-4": { @@ -45,9 +45,6 @@ } }, "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - }, "laravel": { "providers": [ "\\Actuallymab\\LaravelComment\\LaravelCommentServiceProvider"