Skip to content

Commit

Permalink
Add github tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 committed Feb 29, 2024
1 parent d8ab69f commit 7c9a0b6
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/tests export-ignore
/phpunit.xml export-ignore
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 0 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ protected function getEnvironmentSetUp($app)
protected function getPackageProviders($app)
{
return [
ConsoleServiceProvider::class,
ImpersonateServiceProvider::class,
];
}
Expand Down

0 comments on commit 7c9a0b6

Please sign in to comment.