Skip to content

Commit

Permalink
chore:support laravel 11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tintnaingwinn committed Apr 7, 2024
1 parent c4b8c90 commit 8a5d840
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 74 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
name: Check & fix styling
name: Fix PHP code style issues

on: [push]

jobs:
php-code-styling:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: true

steps:
- name: Check out repository code
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress

- name: Check code style
timeout-minutes: 2
run: ./vendor/bin/pint --test --preset laravel
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix styling
25 changes: 18 additions & 7 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,31 @@ on:

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

strategy:
fail-fast: true

name: Static Analysis

steps:
- uses: actions/checkout@v4
- name: Check out repository code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: 8.2
tools: composer:v2
coverage: none

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress
- name: Install composer dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 3
max_attempts: 5
command: composer update --prefer-stable --prefer-dist --no-interaction --no-progress

- name: Run PHPStan
timeout-minutes: 2
run: ./vendor/bin/phpstan --error-format=github
run: ./vendor/bin/phpstan analyse --error-format=github
32 changes: 15 additions & 17 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@ on:

jobs:
test:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04

strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1, 8.2]
laravel: [10.*, 9.*]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
larastan: 2.4.*
- laravel: 9.*
testbench: 7.*
larastan: 2.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
php: [ 8.1, 8.2, 8.3 ]
laravel: [ 9, 10, 11 ]
exclude:
- php: 8.1
laravel: 11
- php: 8.3
laravel: 9

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

steps:
- name: Checkout code
Expand All @@ -34,7 +31,8 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, soap, intl, exif, iconv, fileinfo
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none

- name: Setup problem matchers
Expand All @@ -44,8 +42,8 @@ jobs:
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nunomaduro/larastan:${{ matrix.larastan }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
composer require "laravel/framework:^${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
timeout-minutes: 2
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ jobs:
with:
branch: main
commit_message: Update CHANGELOG
push_options: --force
file_pattern: CHANGELOG.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.php_cs
.php_cs.cache
.phpunit.result.cache
.phpunit.cache
composer.phar
composer.lock
coverage
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[![Latest Version on Packagist](https://img.shields.io/packagist/v/ageekdev/vapor-http-logger.svg?style=flat-square&logo=Packagist)](https://packagist.org/packages/ageekdev/vapor-http-logger)
[![Laravel 9.x](https://img.shields.io/badge/Laravel-9.x-red?style=flat-square&logo=Laravel)](https://laravel.com/docs/9.x)
[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-red?style=flat-square&logo=Laravel)](http://laravel.com)
[![Laravel 10.x](https://img.shields.io/badge/Laravel-10.x-red?style=flat-square&logo=Laravel)](http://laravel.com/docs/10.x)
[![Laravel 11.x](https://img.shields.io/badge/Laravel-11.x-red?style=flat-square&logo=Laravel)](http://laravel.com/docs/11.x)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/ageekdev/vapor-http-logger/run-tests.yml?logo=github&label=tests&style=flat-square)](https://github.com/ageekdev/vapor-http-logger/actions?query=workflow%3Arun-tests+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/ageekdev/vapor-http-logger.svg?style=flat-square&logo=Packagist)](https://packagist.org/packages/ageekdev/vapor-http-logger)

Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
}
],
"require": {
"php": "^8.1|^8.2",
"illuminate/contracts": "^9.0|^10.0"
"php": "^8.1",
"illuminate/contracts": "^9.0|^10.0|^11.0"
},
"require-dev": {
"laravel/pint": "^1.10",
"nunomaduro/collision": "^6.0",
"nunomaduro/larastan": "^2.4.1",
"orchestra/testbench": "^7.0|^8.0",
"larastan/larastan": "^2.4.1",
"orchestra/testbench": "^7.31|^8.11|^9.0",
"pestphp/pest": "^1.0|^2.0",
"pestphp/pest-plugin-laravel": "^1.4|^2.0",
"phpstan/extension-installer": "^1.1",
Expand Down
58 changes: 21 additions & 37 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,39 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="Genie Fintech Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="AGeekDev Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<coverage>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>

0 comments on commit 8a5d840

Please sign in to comment.