Skip to content

Commit

Permalink
Merge pull request #23 from milwad-dev/support-laravel-11
Browse files Browse the repository at this point in the history
[1.x] Support `Laravel 11`
  • Loading branch information
milwad-dev committed Mar 28, 2024
2 parents 212da58 + 37be5d6 commit ec00506
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,51 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.2, 8.1, 8.0]
laravel: [10.*, 9.*]
php: [8.0, 8.1, 8.2, 8.3]
laravel: [9.*, 10.*, 11.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 11.*
testbench: 9.*
pest-plugin-laravel: 2.3.0

- laravel: 10.*
testbench: 8.*
pest-plugin-laravel: 2.0.0

- laravel: 9.*
testbench: 7.*
pest-plugin-laravel: 1.4.0

exclude:
- laravel: 11.*
php: 8.1

- laravel: 11.*
php: 8.0

- laravel: 10.*
php: 8.0

- laravel: 9.*
php: 8.3

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
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: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "nesbot/carbon:^2.63" --dev --no-interaction --no-update
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "pestphp/pest-plugin-laravel:${{ matrix.pest-plugin-laravel }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/pest
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"milwad",
"milwad-dev",
"laravel-attributes",
"laravel attributes",
"easy attributes",
"laravel",
"laravel attributes package"
Expand All @@ -15,18 +16,17 @@
{
"name": "milwad khosravi",
"email": "milwad.dev@gmail.com",
"homepage": "https://milwad.ir",
"homepage": "https://github.com/milwad-dev",
"role": "Developer"
}
],
"require": {
"php": "^8.0",
"illuminate/contracts": "9.*|10.*"
"laravel/framework": "^9.0|^10.0|^11.0"
},
"require-dev": {
"orchestra/testbench": "^7.0 || ^8.0",
"pestphp/pest": "^1.0",
"pestphp/pest-plugin-laravel": "^1.0"
"pestphp/pest-plugin-laravel": "^1.4.0|^2.0.0",
"orchestra/testbench": "^7.0|^8.0|^9.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 4 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Milwad\LaravelAttributes\Tests;

use Illuminate\Support\Facades\Artisan;
use Milwad\LaravelAttributes\LaravelAttributesServiceProvider;

abstract class TestCase extends \Orchestra\Testbench\TestCase
Expand Down Expand Up @@ -37,6 +38,9 @@ protected function getEnvironmentSetUp($app)
protected function setUp(): void
{
parent::setUp();

$this->loadMigrationsFrom(__DIR__.'/SetUp/migrations');

Artisan::call('migrate');
}
}

0 comments on commit ec00506

Please sign in to comment.