Skip to content

Commit

Permalink
Merge pull request #16 from TheDragonCode/patch/2022-01-18/13-34
Browse files Browse the repository at this point in the history
Added Laravel 9 support
  • Loading branch information
Andrey Helldar authored Jan 18, 2022
2 parents 9a0238a + 216c019 commit fc96187
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: phpunit
name: "Laravel 6"
on: [ push ]

jobs:
Expand All @@ -9,11 +9,9 @@ jobs:
fail-fast: true
matrix:
php: [ "7.3", "7.4", "8.0" ]
packages:
- { "laravel": "7.0", "doctrine": "2.6" }
- { "laravel": "8.0", "doctrine": "3.0" }
laravel: [ "6.0" ]

name: PHP ${{ matrix.php }}, L ${{ matrix.packages.laravel }}, D ${{ matrix.packages.doctrine }}
name: PHP ${{ matrix.php }}

services:
mysql:
Expand All @@ -40,7 +38,7 @@ jobs:
coverage: none

- name: Install dependencies
run: composer require --dev laravel/framework:^${{ matrix.packages.laravel }} doctrine/dbal:^${{ matrix.packages.doctrine }}
run: composer require --dev laravel/framework:^${{ matrix.laravel }} doctrine/dbal:^2.6

- name: Execute tests
run: sudo vendor/bin/phpunit
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/laravel-7.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Laravel 7"
on: [ push ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [ "7.3", "7.4", "8.0" ]
laravel: [ "7.0" ]

name: PHP ${{ matrix.php }}

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: default
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

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

- name: Setup Redis
uses: zhulik/[email protected]

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, pdo_mysql
coverage: none

- name: Install dependencies
run: composer require --dev laravel/framework:^${{ matrix.laravel }} doctrine/dbal:^2.6

- name: Execute tests
run: sudo vendor/bin/phpunit
env:
MYSQL_HOST: 127.0.0.1
46 changes: 46 additions & 0 deletions .github/workflows/laravel-8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Laravel 8"
on: [ push ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [ "7.3", "7.4", "8.0", "8.1" ]
laravel: [ "8.0" ]

name: PHP ${{ matrix.php }}

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: default
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

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

- name: Setup Redis
uses: zhulik/[email protected]

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, pdo_mysql
coverage: none

- name: Install dependencies
run: composer require --dev laravel/framework:^${{ matrix.laravel }} doctrine/dbal

- name: Execute tests
run: sudo vendor/bin/phpunit
env:
MYSQL_HOST: 127.0.0.1
46 changes: 46 additions & 0 deletions .github/workflows/laravel-9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Laravel 9"
on: [ push ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [ "8.0", "8.1" ]
laravel: [ "9.0" ]

name: PHP ${{ matrix.php }}

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: default
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

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

- name: Setup Redis
uses: zhulik/[email protected]

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, pdo_mysql
coverage: none

- name: Install dependencies
run: composer require --dev laravel/framework:^${{ matrix.laravel }} doctrine/dbal

- name: Execute tests
run: sudo vendor/bin/phpunit
env:
MYSQL_HOST: 127.0.0.1
17 changes: 10 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@
"require": {
"php": "^7.3 || ^8.0",
"doctrine/dbal": "^2.6 || ^3.0",
"dragon-code/laravel-cache": "^2.3",
"dragon-code/simple-data-transfer-object": "^2.0",
"dragon-code/support": "^5.2",
"illuminate/console": "^6.0 || ^7.0 || ^8.0",
"illuminate/database": "^6.0 || ^7.0 || ^8.0",
"illuminate/support": "^6.0 || ^7.0 || ^8.0",
"dragon-code/laravel-cache": "^2.10",
"dragon-code/simple-data-transfer-object": "^2.1",
"dragon-code/support": "^5.6",
"illuminate/console": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"illuminate/database": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"nesbot/carbon": "^1.20 || ^2.0",
"psr/http-message": "^1.0.1"
},
"require-dev": {
"ext-json": "*",
"mockery/mockery": "^1.3.1",
"orchestra/testbench": "^5.0 || ^6.0",
"orchestra/testbench": "^4.0 || ^5.0 || ^6.0 || ^7.0",
"phpunit/phpunit": "^9.0"
},
"conflict": {
Expand All @@ -57,6 +57,9 @@
}
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true
},
"preferred-install": "dist",
"sort-packages": true
},
Expand Down
9 changes: 7 additions & 2 deletions tests/Concerns/Requests.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@

use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Testing\TestResponse;

trait Requests
{
protected function request(string $url, Carbon $date = null): TestResponse
/**
* @param string $url
* @param \Carbon\Carbon|null $date
*
* @return \Illuminate\Foundation\Testing\TestResponse|\Illuminate\Testing\TestResponse
*/
protected function request(string $url, Carbon $date = null)
{
if (! empty($date)) {
$this->withHeader('If-Modified-Since', $date->format('r'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CreateCustomTable extends Migration
public function up()
{
Schema::create('custom', function (Blueprint $table) {
$table->id();
$table->bigIncrements('id');

$table->string('slug');

Expand Down

0 comments on commit fc96187

Please sign in to comment.