From 7d840286fa3dd95f72d7d6c8250f4eaa7aba75e0 Mon Sep 17 00:00:00 2001 From: Robert Allport Date: Tue, 12 Mar 2024 10:48:30 +0000 Subject: [PATCH] Drop legacy support, Support Laravel 11 (#7) * Drop legacy support, Support Laravel 11 --- .github/workflows/run-tests-laravel-8.yml | 54 ------------------- ...{run-tests-laravel-7.yml => run-tests.yml} | 44 +++++++++------ README.md | 7 ++- composer.json | 10 ++-- phpunit.xml.dist | 44 +++++---------- 5 files changed, 52 insertions(+), 107 deletions(-) delete mode 100644 .github/workflows/run-tests-laravel-8.yml rename .github/workflows/{run-tests-laravel-7.yml => run-tests.yml} (58%) diff --git a/.github/workflows/run-tests-laravel-8.yml b/.github/workflows/run-tests-laravel-8.yml deleted file mode 100644 index f12a70a..0000000 --- a/.github/workflows/run-tests-laravel-8.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: run-tests-laravel-8 - -on: [push, pull_request] - -jobs: - tests: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - php: [7.4, 8.0, 8.1] - laravel: [8.*, 9.*, 10.*] - dependency-version: [prefer-stable] - include: - - laravel: 10.* - testbench: 8.* - - laravel: 8.* - testbench: 6.* - - laravel: 9.* - testbench: 7.* - exclude: - - laravel: 9.* - php: 7.4 - - laravel: 10.* - php: 8.0 - - laravel: 10.* - php: 7.4 - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Cache dependencies - uses: actions/cache@v2 - with: - path: ~/.composer/cache/files - key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, sqlite, pdo_sqlite, iconv - coverage: none - - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction - - name: Execute tests - run: vendor/bin/phpunit --color=always tests diff --git a/.github/workflows/run-tests-laravel-7.yml b/.github/workflows/run-tests.yml similarity index 58% rename from .github/workflows/run-tests-laravel-7.yml rename to .github/workflows/run-tests.yml index 666449b..88467ce 100644 --- a/.github/workflows/run-tests-laravel-7.yml +++ b/.github/workflows/run-tests.yml @@ -1,4 +1,4 @@ -name: run-tests-laravel-7 +name: "Run Tests - Current" on: [push, pull_request] @@ -9,33 +9,39 @@ jobs: strategy: fail-fast: false matrix: - php: [8.0, 7.4, 7.2] - laravel: [7.*, 6.*, 5.8.*] + php: [8.3, 8.2, 8.1, 8.0] + laravel: ["^11.0", "^10.0", "^9.0", "^8.12"] dependency-version: [prefer-lowest, prefer-stable] include: - - laravel: 7.* - testbench: 5.* - - laravel: 6.* - testbench: 4.* - - laravel: 5.8.* - testbench: 3.8.* + - laravel: ^11.0 + testbench: 9.* + - laravel: ^10.0 + testbench: 8.* + - laravel: ^9.0 + testbench: 7.* + - laravel: ^8.12 + testbench: ^6.23 exclude: - - laravel: 5.8.* - php: 8.0 - - laravel: 5.8.* - php: 7.4 + - laravel: ^10.0 + php: 8.0 + - laravel: ^8.12 + php: 8.3 + - laravel: ^11.0 + php: 8.1 + - laravel: ^11.0 + php: 8.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.composer/cache/files - key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -48,5 +54,9 @@ jobs: run: | composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "symfony/console:>=4.3.4" "mockery/mockery:^1.3.2" --no-interaction --no-update composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction + + - name: Display PHP version + run: php -v | grep ^PHP | cut -d' ' -f2 + - name: Execute tests - run: vendor/bin/phpunit --color=always tests + run: vendor/bin/phpunit diff --git a/README.md b/README.md index c44109d..c7395ed 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,12 @@ Some super useful redirect response macros to simplify your Laravel application. ## Requirements -Laravel `>=5.8 | 6.x | 7.x | 8.x | 9.x | 10.x` supported +- PHP `^8.0` +- Laravel `^8.12`, `^9.0`, `^10.0` or `^11.0` + +### Legacy Support + +For legacy PHP / Laravel support, use package version [`1.1.6`](https://github.com/f9webltd/laravel-redirect-response-macros/tree/1.1.6) ## Installation diff --git a/composer.json b/composer.json index 2584ee5..03b03a1 100644 --- a/composer.json +++ b/composer.json @@ -17,13 +17,13 @@ "role": "Developer" } ], - "require": { - "php": "^7.2|^8.0", - "laravel/framework": "5.8.* || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0" + "require": { + "php": "^8.0", + "illuminate/support": "^8.12|^9.0|^10.0|^11.0" }, "require-dev": { - "orchestra/testbench": ">=3.8", - "phpunit/phpunit": "^7.0|^8.0|^9.3" + "orchestra/testbench": "^6.23|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.4|^10.1" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 998e7d0..27e7940 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,33 +1,17 @@ - - - - tests - - - - - src/ - - - - - - - - - - - - + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" +> + + + src/ + + + + + tests + + -