From ac4c4f3b0cbcc11964ec6c9f152f5ead2d9d9cfa Mon Sep 17 00:00:00 2001 From: Seth Phat Date: Wed, 13 Mar 2024 21:14:57 +0700 Subject: [PATCH] Support Laravel 11 --- .github/workflows/build.yml | 27 ++++++++++++++++++-- .github/workflows/try-installation.yml | 35 ++++++++++++++++++++++++++ README.md | 2 +- composer.json | 2 +- 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/try-installation.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f2fc86..51524a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: - 'main' jobs: - build: + build_php82: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -19,7 +19,7 @@ jobs: - name: Setup PHP with coverage driver uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.version }} + php-version: 8.2 coverage: pcov - name: Bootstrap project @@ -39,3 +39,26 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} file: ./coverage.xml + + build_php83: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + if: success() + + - name: Setup PHP with coverage driver + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + coverage: pcov + + - name: Bootstrap project + if: success() + run: | + php -v + composer install --no-interaction + + - name: PHPUnit tests with coverage + if: success() && github.event.pull_request.draft == false + run: | + composer test \ No newline at end of file diff --git a/.github/workflows/try-installation.yml b/.github/workflows/try-installation.yml new file mode 100644 index 0000000..1cfcf4b --- /dev/null +++ b/.github/workflows/try-installation.yml @@ -0,0 +1,35 @@ +name: Try Install Package (Laravel 10 & 11) + +env: + LOCAL_ENV: ${{ secrets.LOCAL_ENV }} + +on: + push: + branches: + - 'main' + +jobs: + build: + strategy: + fail-fast: false + matrix: + version: [ '^10.0', '^11.0' ] + runs-on: ubuntu-latest + steps: + - name: Setup PHP with coverage driver + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + coverage: pcov + + - name: Setup and install package on Laravel + if: success() + run: | + sudo service mysql start + mysql -uroot -proot -e "CREATE DATABASE priority_queue;" + composer create-project laravel/laravel:${{ matrix.version }} laravel + cd laravel + composer require shipsaas/laravel-priority-queue + php artisan vendor:publish --tag=priority-queue-migrations + echo "$LOCAL_ENV" > .env + php artisan migrate diff --git a/README.md b/README.md index f1d037b..6d35303 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ A simple yet super effective method to skyrocketing your API responding times > Laravel Resource Reducer is heavily inspired from GraphQL approach. ❤️ ## Supports -- Laravel 10+ +- Laravel 10 & 11 - PHP 8.2+ ### Compatibility diff --git a/composer.json b/composer.json index c75bdf7..db71cca 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ ], "license": "MIT", "require": { - "php": "^8.2", + "php": ">=8.2", "laravel/framework": "^10|dev-master" }, "require-dev": {