-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from SAM-IT/deprecate-unused-features
feat!: update to latest php clean up package"
- Loading branch information
Showing
19 changed files
with
408 additions
and
6,021 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,52 @@ | ||
name: Continous integration | ||
on: [push, pull_request] | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
cs: | ||
name: Check code style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
tools: phpcs | ||
extensions: xmlwriter | ||
- uses: actions/checkout@v3 | ||
- uses: ramsey/composer-install@v2 | ||
- name: Test code style | ||
run: phpcs | ||
run: vendor/bin/ecs | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: ['7.4'] | ||
php: ['8.1', '8.2'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: pecl | ||
coverage: pcov | ||
extensions: mbstring, curl, json, pdo-sqlite | ||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Cache dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ matrix.php }}-composer- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist | ||
- uses: ramsey/composer-install@v2 | ||
- name: Run tests | ||
run: composer test -- --coverage-xml | ||
- name: Get Ocular | ||
run: wget https://scrutinizer-ci.com/ocular.phar | ||
- name: Push code coverage | ||
run: php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml | ||
release: | ||
name: Automated release | ||
needs: [test, cs] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '14.x' | ||
- name: install dependencies for semantic-release | ||
run: npm ci | ||
- run: $(npm bin)/semantic-release | ||
node-version: 18 | ||
- run: > | ||
npx | ||
-p "@semantic-release/commit-analyzer" | ||
-p "@semantic-release/release-notes-generator" | ||
-p conventional-changelog-conventionalcommits | ||
-p semantic-release | ||
-- semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
permissions: | ||
packages: read | ||
contents: read |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
// ecs.php | ||
use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff; | ||
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer; | ||
use PhpCsFixer\Fixer\ClassNotation\FinalInternalClassFixer; | ||
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer; | ||
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer; | ||
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer; | ||
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer; | ||
use Symplify\EasyCodingStandard\Config\ECSConfig; | ||
use Symplify\EasyCodingStandard\ValueObject\Set\SetList; | ||
|
||
return static function (ECSConfig $ecsConfig): void { | ||
// Parallel | ||
$ecsConfig->parallel(); | ||
|
||
// Paths | ||
$ecsConfig->paths([ | ||
__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/ecs.php' | ||
]); | ||
|
||
// A. full sets | ||
$ecsConfig->sets([SetList::PSR_12, SetList::SPACES]); | ||
|
||
$ecsConfig->rule(NotOperatorWithSuccessorSpaceFixer::class); | ||
$ecsConfig->rule(ArraySyntaxFixer::class); | ||
$ecsConfig->rule(NoUnusedImportsFixer::class); | ||
$ecsConfig->rule(DeclareStrictTypesFixer::class); | ||
$ecsConfig->ruleWithConfiguration(FinalInternalClassFixer::class, [ | ||
'annotation_exclude' => ['@not-fix'], | ||
'annotation_include' => [], | ||
'consider_absent_docblock_as_internal_class' => \true | ||
]); | ||
$ecsConfig->rule(PhpdocAlignFixer::class); | ||
|
||
$ecsConfig->ruleWithConfiguration(ForbiddenFunctionsSniff::class, [ | ||
'forbiddenFunctions' => [ | ||
'passthru' => null, | ||
'var_dump' => null, | ||
] | ||
]); | ||
$ecsConfig->skip([ | ||
NotOperatorWithSuccessorSpaceFixer::class, | ||
__DIR__ . '/tests/_support/_generated/*' | ||
]); | ||
}; |
Oops, something went wrong.