From 62cad20d1a9c572b35f3ae5047a08c53e97a8626 Mon Sep 17 00:00:00 2001 From: Christopher Gammie Date: Mon, 24 Feb 2025 18:50:38 +0000 Subject: [PATCH] feat: add support for Laravel 12 --- .github/workflows/tests.yml | 65 ++++++++++++++++++++++--------------- composer.json | 12 +++---- 2 files changed, 44 insertions(+), 33 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eaf0932..0ccf703 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,9 +2,13 @@ name: Tests on: push: - branches: [ main, develop ] + branches: + - main + - develop pull_request: - branches: [ main, develop ] + branches: + - main + - develop jobs: build: @@ -15,30 +19,37 @@ jobs: fail-fast: true matrix: php: [8.2, 8.3, 8.4] - core: ['4.3.2', '5.0.1'] + core: ['4.3.2', '5.2'] + laravel: [11, 12] + exclude: + - laravel: 12 + core: '4.3.2' steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip - tools: composer:v2 - coverage: none - ini-values: error_reporting=E_ALL - - - name: Set Laravel JSON:API Core Version - run: composer require "laravel-json-api/core:^${{ matrix.core }}" --no-update - - - name: Install dependencies - uses: nick-fields/retry@v3 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer update --prefer-dist --no-interaction --no-progress - - - name: Execute tests - run: vendor/bin/phpunit + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip + tools: composer:v2 + coverage: none + ini-values: error_reporting=E_ALL + + - name: Set Laravel JSON:API Core Version + run: composer require "laravel-json-api/core:^${{ matrix.core }}" --no-update + + - name: Set Laravel Version + run: composer require "illuminate/contracts:^${{ matrix.laravel }}" --no-update + + - name: Install dependencies + uses: nick-fields/retry@v3 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer update --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 048388f..4692b79 100644 --- a/composer.json +++ b/composer.json @@ -25,13 +25,13 @@ "require": { "php": "^8.2", "ext-json": "*", - "illuminate/contracts": "^11.0", - "illuminate/support": "^11.0", - "laravel-json-api/core": "^4.3.2|^5.0.1" + "illuminate/contracts": "^11.0|^12.0", + "illuminate/support": "^11.0|^12.0", + "laravel-json-api/core": "^4.3.2|^5.2" }, "require-dev": { - "orchestra/testbench": "^9.0", - "phpunit/phpunit": "^10.5" + "orchestra/testbench": "^9.0|^10.0", + "phpunit/phpunit": "^10.5|^11.0" }, "autoload": { "psr-4": { @@ -53,7 +53,7 @@ ] } }, - "minimum-stability": "stable", + "minimum-stability": "dev", "prefer-stable": true, "config": { "sort-packages": true