diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index 765561a..3ee2ecb 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -2,20 +2,53 @@ name: Laravel on: push: - branches: [ master ] + branches: [ master, main ] pull_request: - branches: [ master ] + branches: [ master, main ] jobs: laravel-tests: - runs-on: ubuntu-latest + strategy: + matrix: + php-version: ['8.2', '8.3'] + laravel-version: ['8.*', '9.*', '10.*', '11.*'] + include: + - laravel-version: '8.*' + testbench-version: '^6.0' + - laravel-version: '9.*' + testbench-version: '^7.0' + - laravel-version: '10.*' + testbench-version: '^8.0' + - laravel-version: '11.*' + testbench-version: '^9.0' + + name: PHP ${{ matrix.php-version }} - Laravel ${{ matrix.laravel-version }} + steps: - - uses: actions/checkout@v2 - - name: Copy .env - run: php -r "file_exists('.env') || copy('.env.example', '.env');" - - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv + coverage: none + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php-version }}- + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel-version }}" "orchestra/testbench:${{ matrix.testbench-version }}" --no-interaction --no-update + composer update --prefer-dist --no-interaction --no-suggest + - name: Execute tests (Unit and Feature tests) via PHPUnit run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 063b392..95b45a1 100644 --- a/composer.json +++ b/composer.json @@ -19,14 +19,14 @@ } ], "require": { - "php": "^8.0", - "illuminate/support": "^8.0|^9.0|^10.0", + "php": "^8.2", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0", "spatie/laravel-webhook-client": "^3.0", - "twilio/sdk": "^6.37|^7.0" + "twilio/sdk": "^6.37|^7.0|^8.0" }, "require-dev": { - "orchestra/testbench": "^6.0|^7.0|^8.0", - "phpunit/phpunit": "^9.4|^10.0" + "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.4|^10.0|^11.0" }, "autoload": { "psr-4": { diff --git a/tests/TestCase.php b/tests/TestCase.php index a5c6e1b..9aab1d2 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,7 +3,7 @@ namespace Tests; use BinaryCats\TwilioWebhooks\TwilioWebhooksServiceProvider; -use Exception; +use Throwable; use Illuminate\Contracts\Debug\ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler; use Orchestra\Testbench\TestCase as OrchestraTestCase; @@ -68,8 +68,8 @@ protected function disableExceptionHandling() $this->app->instance(ExceptionHandler::class, new class extends Handler { public function __construct(){} - public function report(Exception $e){} - public function render($request, Exception $exception){throw $exception;} + public function report(Throwable $e){} + public function render($request, Throwable $exception){throw $exception;} }); } }