Skip to content

Commit

Permalink
qa/workflow-improvements (#40)
Browse files Browse the repository at this point in the history
* Mark package as abandoned and update README with new package info.

The `composer.json` now indicates that `dropelikeit/laravel-responsefactory` is abandoned. The README advises users to transition to a new package that offers additional functions, and support will extend only until Laravel 11's end.

* Add .php-cs-fixer.cache to .gitignore

Ignore the cache file generated by PHP-CS-Fixer to prevent unintentional version control. This helps maintain a clean repository, avoiding unnecessary files from being tracked.

* Enable cache directory assertion

Re-enable the assertion to ensure the cache directory is a non-empty string. This change helps prevent potential errors related to invalid cache directory configurations. Adjustments improve code reliability and enforce stricter input validation.

* Remove unnecessary assertion from cache directory setup

The assertion ensuring the cache directory is not empty has been removed to simplify the code, as its necessity was reevaluated. A comment has been added to suppress PHPStan warnings on this line, ensuring the codebase remains free of analysis errors.

* Update dependencies and add PHP 8.4 workflow

Upgraded versions of Psalm, its Laravel plugin, and Infection in `composer.json`. Simplified PHP CS Fixer command in the CI workflow. Added a new workflow to support testing and analysis for PHP 8.4.

* Update infection/infection version constraint in composer.json

Allow compatibility with both 0.27.10 and ^0.29.10 versions. This change ensures greater flexibility in dependency resolution while maintaining support for specific versions.

* Update Psalm dependency to support version 5.x

This change ensures compatibility with both Psalm 5.x and 6.x. It provides greater flexibility for projects that rely on older versions of Psalm while maintaining support for the latest version.
  • Loading branch information
Dropelikeit authored Jan 28, 2025
1 parent 4357297 commit 4138bd5
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run: "composer test-coverage"

- name: "Run PHP CS Check"
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"
run: "composer cs-check"

- name: "Run PHPStan"
run: "composer analyze"
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
run: "composer test-coverage"

- name: "Run PHP CS Check"
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"
run: "composer cs-check"

- name: "Run PHPStan"
run: "composer analyze"
Expand All @@ -133,4 +133,46 @@ jobs:
- name: "Run infection"
env:
INFECTION_BADGE_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: "composer infection-ci"

php84:
name: PHP 8.4
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2

- name: "Install PHP 8.4"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.4"

- name: "Cache composer packages"
uses: "actions/cache@v4"
with:
path: "vendor"
key: "php-composer-locked-php-8.4-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-composer-locked-php-8.3-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --prefer-dist"

- name: "Run PHPUnit Tests"
run: "composer test-coverage"

- name: "Run PHP CS Check"
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"

- name: "Run PHPStan"
run: "composer analyze"

- name: "Run Psalm"
run: "composer psalm"

- name: "PHP Lint"
run: "composer lint"

- name: "Run infection"
run: "composer infection-ci"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# PHPUnit specific
.phpunit.result.cache
.php-cs-fixer.cache

# Composer
/vendor/
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ JMS-Serializer: https://github.com/schmittjoh/serializer

You are also welcome to use the Issue Tracker to set bugs, improvements or upgrade requests.

> Please use the new package https://github.com/Dropelikeit/laravel-responsefactory in the future. The new package contains some new and useful functions!
This package will only be supported until the end of Laravel 11. Until then, you should use the new package.

### Installation

``` composer require dropelikeit/laravel-jms-serializer ```
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"keywords": ["Lumen", "Laravel", "JMS Serializer", "JMS"],
"minimum-stability": "stable",
"license": "MIT",
"abandoned": "dropelikeit/laravel-responsefactory",
"authors": [
{
"name": "Marcel Strahl",
Expand Down Expand Up @@ -44,10 +45,10 @@
"phpstan/phpstan-phpunit": "^1.3",
"php-parallel-lint/php-parallel-lint": "^1.3",
"symfony/cache": "^6.3|^7.0",
"vimeo/psalm": "^5.23",
"psalm/plugin-laravel": "^2.10",
"vimeo/psalm": "^5.0|^6.0",
"psalm/plugin-laravel": "^2.11",
"psalm/plugin-phpunit": "^0.19",
"infection/infection": "^0.27.10",
"infection/infection": "0.27.10|^0.29.10",
"laravel/framework": "^10.0|^v11.0"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ private function __construct(
array $customHandlers,
) {
$cacheDir = sprintf('%s%s', $cacheDir, self::CACHE_DIR);
#Assert::stringNotEmpty($cacheDir);

// @phpstan-ignore-next-line
$this->cacheDir = $cacheDir;
$this->customHandlers = $customHandlers;
}
Expand Down

0 comments on commit 4138bd5

Please sign in to comment.