From 7c9a0b62af6f99e042650e53c2f51060d70eb819 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Thu, 29 Feb 2024 10:27:48 -0500 Subject: [PATCH] Add github tests --- .gitattributes | 1 + .github/workflows/run-tests.yml | 59 +++++++++++++++++++++++++++++++++ composer.json | 5 ++- readme.md | 4 +-- tests/TestCase.php | 1 - 5 files changed, 64 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/run-tests.yml diff --git a/.gitattributes b/.gitattributes index 4a6021f..634b37f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ /.gitattributes export-ignore +/.github export-ignore /.gitignore export-ignore /tests export-ignore /phpunit.xml export-ignore diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..9c3e970 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,59 @@ +name: "Tests" + +on: [push, pull_request] + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [8.3, 8.2, 8.1] + laravel: ["^11.0", "^10.0", "^9.0", "^8.12"] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: "^11.0" + testbench: 9.* + - laravel: "^10.0" + testbench: 8.* + - laravel: "^9.0" + testbench: 7.* + - laravel: "^8.12" + testbench: "^6.23" + - laravel: "^7.0" + testbench: 5.* + php: "8.0" + dependency-version: prefer-stable + - laravel: "^6.0" + testbench: 4.* + php: "8.0" + dependency-version: prefer-stable + exclude: + - laravel: "^11.0" + php: 8.1 + - laravel: "^10.0" + php: "8.0" + - laravel: "^8.12" + php: 8.3 + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv + coverage: none + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:>=2.62.1" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction + + - name: Execute tests + run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index 627ffe1..36d562f 100644 --- a/composer.json +++ b/composer.json @@ -15,13 +15,12 @@ ], "require": { "php": "^7.2 | ^8.0", - "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0" + "laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0" }, "require-dev": { "phpunit/phpunit": "^7.5 | ^8.0 | ^9.0 | ^10.0", "mockery/mockery": "^1.3.3", - "orchestra/testbench": "^4.0 | ^5.0 | ^6.0 | ^7.0 | ^8.0", - "orchestra/database": "^4.0 | ^5.0 | ^6.0 | ^7.0 | ^8.0" + "orchestra/testbench": "^4.0 | ^5.0 | ^6.0 | ^7.0 | ^8.0 | ^9.0" }, "license": "MIT", "authors": [ diff --git a/readme.md b/readme.md index 18a8e41..2d4e400 100644 --- a/readme.md +++ b/readme.md @@ -21,14 +21,14 @@ ## Requirements -- Laravel 6.x to 9.x +- Laravel 6.x to 11.x - PHP >= 7.2 or >= 8.0 ### Laravel support | Version | Release | |:-------------:|:-------------:| -| 6.x to 10.x | 1.7 | +| 6.x to 11.x | 1.7 | | 6.x, 7.x | 1.6 | | 5.8 | 1.5 | | 5.7, 5.6 | 1.2 | diff --git a/tests/TestCase.php b/tests/TestCase.php index 1013678..dc97b3d 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -67,7 +67,6 @@ protected function getEnvironmentSetUp($app) protected function getPackageProviders($app) { return [ - ConsoleServiceProvider::class, ImpersonateServiceProvider::class, ]; }