Skip to content

Commit

Permalink
updates tests and dev libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
rosven9856 committed May 23, 2024
1 parent 7c2ad8f commit 80bff39
Show file tree
Hide file tree
Showing 10 changed files with 6,626 additions and 358 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
.github
var
vendor
104 changes: 103 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
tools: composer:v2
coverage: none
- run: composer validate --strict --ansi
# check-require:
# composer-require-checker:
# runs-on: ubuntu-latest
# strategy:
# matrix:
Expand All @@ -57,3 +57,105 @@ jobs:
# with:
# composer-options: --optimize-autoloader
# - run: composer require-checker
composer-unused:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- 8.3
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v2
with:
composer-options: --optimize-autoloader
- run: composer unused
composer-normalize:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- 8.3
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v2
with:
composer-options: --optimize-autoloader
- run: composer normalize --dry-run --diff --ansi
# php-cs-fixer:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# php:
# - 8.3
# steps:
# - uses: actions/checkout@v4
# - uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php }}
# tools: composer:v2, cs2pr
# coverage: none
# - uses: ramsey/composer-install@v2
# with:
# composer-options: --optimize-autoloader
# - run: composer fixcs -- --dry-run --diff --format=checkstyle --ansi | cs2pr
rector:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- 8.3
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v2
with:
composer-options: --optimize-autoloader
- run: composer rector -- --dry-run
psalm:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- 8.3
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
- uses: ramsey/composer-install@v2
with:
composer-options: --optimize-autoloader
- run: composer psalm -- --php-version=${{ matrix.php }} --stats --output-format=github --shepherd
phpunit:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- 8.3
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: xdebug
- uses: ramsey/composer-install@v2
with:
composer-options: --optimize-autoloader
- run: composer test -- --colors=always --order-by=random --coverage-clover coverage.xml
25 changes: 25 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

use PHPyh\CodingStandard\PhpCsFixerCodingStandard;

$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->append([
__FILE__,
])
->notPath([
'benchmark.php',
]);

$config = (new PhpCsFixer\Config())
->setFinder($finder)
->setCacheFile(__DIR__ . '/var/.php-cs-fixer.cache');

(new PhpCsFixerCodingStandard())->applyTo($config);

return $config;
44 changes: 37 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,47 @@
"name": "rosven9856/composer-package-action",
"description": "",
"license": "MIT",
"authors": [
{
"name": "rosven9856",
"email": "[email protected]"
}
],
"require-dev": {
"ergebnis/composer-normalize": "^2.42",
"friendsofphp/php-cs-fixer": "^3.57",
"icanhazstring/composer-unused": "^0.8.11",
"maglnet/composer-require-checker": "^4.11",
"phpunit/phpunit": "^10.4.2",
"phpyh/coding-standard": "^2.6",
"psalm/plugin-phpunit": "^0.18.4",
"rector/rector": "^1.1",
"vimeo/psalm": "^5.24"
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\": "tests/"
}
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"infection/extension-installer": true
},
"sort-packages": true
},
"scripts": {
"require-checker": "composer-require-checker check --config-file=composer-require-checker.json composer.json",
"check-unused": "composer-unused",
"fixcs": "php-cs-fixer fix --diff --verbose",
"infection": "infection --threads=max --show-mutations",
"pre-command-run": "mkdir -p var",
"psalm": "psalm --show-info=true --no-diff",
"rector": "rector process",
"test": "phpunit"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.11"
"require-checker": "composer-require-checker check --config-file=composer-require-checker.json composer.json",
"test": "phpunit",
"unused": "composer-unused"
}
}
Loading

0 comments on commit 80bff39

Please sign in to comment.