Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test with php nightly build #31

Merged
merged 4 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ jobs:
matrix:
php:
- "8.3"
laravel:
- "^10.0"
- "8.4"
stability:
- lowest
- stable
package:
- l5-swagger
- laravel-openapi
include:
- option: --ignore-platform-req=php
php: "8.4"

name: ${{ matrix.package }} / ${{ matrix.stability }}
name: PHP:${{ matrix.php }} / ${{ matrix.package }} / ${{ matrix.stability }}

steps:
- name: Checkout
Expand All @@ -39,7 +41,7 @@ jobs:

- name: Install Composer dependencies
run: |
composer update --prefer-${{ matrix.stability }} --no-interaction --no-progress --ansi
composer update --prefer-${{ matrix.stability }} ${{ matrix.option }} --no-interaction --no-progress --ansi
working-directory: e2e/${{ matrix.package }}

- name: Run Unit tests
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/package-installation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
laravel:
- "^9.0"
- "^10.0"
include:
- option: --ignore-platform-req=php
php: "8.4"

name: PHP:${{ matrix.php }} / Laravel:${{ matrix.laravel }}

Expand All @@ -29,6 +33,6 @@ jobs:
tools: composer:v2
coverage: none

- run: composer create-project laravel/laravel:${{ matrix.laravel }} ./
- run: composer require kentaroutakeda/laravel-openapi-validator --no-interaction --no-progress --ansi
- run: composer create-project ${{ matrix.option }} laravel/laravel:${{ matrix.laravel }} ./
- run: composer require ${{ matrix.option }} kentaroutakeda/laravel-openapi-validator --no-interaction --no-progress --ansi
- run: vendor/bin/phpunit
21 changes: 14 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
laravel:
- "^9.0"
- "^10.0"
stability:
- lowest
- stable
include:
- current: 1
php: "8.3"
laravel: "^10.0"
stability: stable
- option: --ignore-platform-req=php
php: "8.4"

name: PHP:${{ matrix.php }} / Laravel:${{ matrix.laravel }} / ${{ matrix.stability }}

Expand All @@ -40,16 +48,15 @@ jobs:
- name: Install Composer dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update --ansi
composer update --prefer-${{ matrix.stability }} --no-interaction --no-progress --ansi
composer update --prefer-${{ matrix.stability }} ${{ matrix.option }} --no-interaction --no-progress --ansi

- name: Run Code Format Check
if: ${{ matrix.stability == 'stable' }}
run: vendor/bin/php-cs-fixer check
if: ${{ matrix.current }}
run: vendor/bin/php-cs-fixer check --show-progress=none --ansi

- name: Run Static Analysis
run: vendor/bin/phpstan analyze
if: ${{ matrix.current }}
run: vendor/bin/phpstan analyze --no-progress --ansi

- name: Run Unit tests
run: vendor/bin/phpunit
env:
APP_DEBUG: true
run: vendor/bin/phpunit --colors=always
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,13 @@
"config": {
"optimize-autoloader": true,
"sort-packages": true
},
"scripts": {
"post-autoload-dump": [
"@clear",
"@prepare"
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi"
}
}
8 changes: 8 additions & 0 deletions tests/Feature/Http/Controllers/DocumentControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@

namespace KentarouTakeda\Laravel\OpenApiValidator\Tests\Feature\Http\Controllers;

use Illuminate\Config\Repository;
use KentarouTakeda\Laravel\OpenApiValidator\Tests\Feature\TestCase;

class DocumentControllerTest extends TestCase
{
protected function defineEnvironment($app)
{
tap($app['config'], fn (Repository $config) => $config->set(
['openapi-validator.is_swagger_ui_enabled' => true],
));
}

/**
* @test
*/
Expand Down