Skip to content

Commit

Permalink
[V2] (#54)
Browse files Browse the repository at this point in the history
Bump PHP requirements to 8.1, cleanup dependencies and use attributes instead of annotations for fixtures.
  • Loading branch information
DerManoMann committed Mar 25, 2024
1 parent a0101e4 commit d8dc674
Show file tree
Hide file tree
Showing 20 changed files with 505 additions and 232 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/build.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: code-style

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
php-cs:
Expand All @@ -14,7 +18,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.2'

- uses: ramsey/composer-install@v3
with:
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: laravel

on:
workflow_call:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
Expand All @@ -10,14 +15,12 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest ]
php: [ '7.2', '7.3', '7.4', '8.0' ]
laravel: [ '7.0', '8.0' ]
php: [ '8.1', '8.2', '8.3' ]
laravel: [ '10.0', '11.0' ]
dependencies: [ 'lowest', 'highest' ]
exclude:
- php: '7.2'
laravel: '8.0'
- php: '8.0'
dependencies: 'lowest'
- php: '8.1'
laravel: '11.0'

name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies

Expand Down Expand Up @@ -47,13 +50,18 @@ jobs:
dependency-versions: ${{ matrix.dependencies }}
composer-options: ${{ matrix.composer-options }}

- name: PHPUnit
run: |
vendor/bin/phpunit
- name: PHPUnit + Code coverage
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
if: matrix.php == '8.2' && matrix.dependencies == 'highest' && matrix.laravel == '8.2'

- name: Code coverage upload to Coveralls
if: matrix.php == '8.0' && matrix.dependencies == 'highest' && matrix.laravel == '8.0'
if: matrix.php == '8.2' && matrix.dependencies == 'highest' && matrix.laravel == '8.2'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/security-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ name: security-checks

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
security-checker:
Expand All @@ -11,13 +15,13 @@ jobs:
fail-fast: true
matrix:
operating-system: [ ubuntu-latest ]
php: [ '7.2', '7.3', '7.4', '8.0' ]
php: [ '8.1', '8.2', '8.3', '8.4' ]
dependencies: [ 'highest' ]

name: PHP ${{ matrix.php }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
name: Checkout repository

- name: Setup PHP
Expand All @@ -37,4 +41,4 @@ jobs:
path: ~/.symfony/cache
key: security-checker-db

- uses: symfonycorp/security-checker-action@v2
- uses: symfonycorp/security-checker-action@v5
14 changes: 9 additions & 5 deletions .github/workflows/slim.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: slim

on:
workflow_call:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
Expand All @@ -10,8 +15,8 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest ]
php: [ '7.2', '7.3', '7.4', '8.0' ]
slim: [ '3.12', '4.0' ]
php: [ '8.1', '8.2', '8.3', '8.4' ]
slim: [ '4.0' ]
dependencies: [ 'lowest', 'highest' ]

name: PHP ${{ matrix.php }} / Slim ${{ matrix.slim }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies
Expand Down Expand Up @@ -45,5 +50,4 @@ jobs:

- name: PHPUnit + Code coverage
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.php-cs-fixer.cache
composer.lock
vendor/
/.phpunit.cache/test-results
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Allows to validate a controller response from your API project against a given [
specification.

## Requirements
* [PHP 7.1 or higher](http://www.php.net/)
* [PHP 8.1 or higher](http://www.php.net/)

## Installation
You can use **composer** or simply **download the release**.
Expand Down
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* Add docs about what the validation covers (required...)
* Add guzzle middleware
26 changes: 14 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"refresh-specs": [
"@php vendor/bin/openapi tests/Fixtures -o tests/specifications/users.json",
"@php vendor/bin/openapi tests/Fixtures -o tests/specifications/users.yaml"
],
"analyse": [
"export XDEBUG_MODE=off && phpstan analyse --memory-limit=2G"
]
},
"config": {
Expand All @@ -39,24 +42,23 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
"dev-master": "2.x-dev"
}
},
"require": {
"php": ">=7.2",
"ext-json": "*",
"doctrine/annotations": "^1.7",
"justinrainbow/json-schema": "^5.2",
"php": ">=8.1",
"ext-json": "*", "justinrainbow/json-schema": "^5.2.13",
"nyholm/psr7": "^1.1",
"nyholm/psr7-server": "^1.0.0",
"psr/http-message": "^1.0",
"symfony/psr-http-message-bridge": "^2.0"
"nyholm/psr7-server": "^1.0",
"psr/http-message": "^2.0",
"symfony/psr-http-message-bridge": "^6.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpunit/phpunit": ">=8.0",
"symfony/yaml": "^4.3|^5",
"zircote/swagger-php": "^3.1"
"friendsofphp/php-cs-fixer": "^3.47.1",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.0",
"symfony/yaml": "^6.0|^7.0",
"zircote/swagger-php": "^4.8"
},
"suggest": {
"laravel/laravel": "A PHP framework",
Expand Down

0 comments on commit d8dc674

Please sign in to comment.