Skip to content

Commit 83ac70a

Browse files
committed
chore: merge branch 'master' into mailer-proxy-alternative
2 parents 7adc7f7 + ce1e2fa commit 83ac70a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2595
-508
lines changed
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
name: CI
2-
3-
on: [push, pull_request]
4-
2+
on:
3+
pull_request:
54
jobs:
65
tests:
76
runs-on: ubuntu-latest
8-
97
strategy:
108
matrix:
119
php: [8.3, 8.4]
12-
1310
steps:
1411
- name: Checkout code
1512
uses: actions/checkout@v4
@@ -20,16 +17,15 @@ jobs:
2017
php-version: ${{ matrix.php }}
2118
extensions: pdo, sqlite, imagick
2219
coverage: none
23-
2420
- name: Validate composer.json and composer.lock
2521
run: composer validate
26-
2722
- name: Install dependencies
2823
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
29-
- name: Run PHPStan
30-
run: php vendor/bin/phpstan
31-
24+
- name: Run ECS
25+
run: php vendor/bin/ecs
3226
- name: Run test suite
3327
run: |
3428
php vendor/bin/codecept build
3529
php vendor/bin/codecept run
30+
- name: Run PHPStan
31+
run: php vendor/bin/phpstan

.github/workflows/release.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Automated release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
static_analysis:
8+
name: Static Analysis
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Setup PHP with PECL extension
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.4'
16+
- uses: ramsey/composer-install@v3
17+
- name: Initialize cache
18+
uses: actions/cache@v4
19+
with:
20+
key: phpstan
21+
path: .phpstan-cache
22+
- name: Run ECS
23+
run: php vendor/bin/ecs
24+
- name: Build test files
25+
run: vendor/bin/codecept build
26+
- name: Run PHPStan
27+
run: vendor/bin/phpstan
28+
tests:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
php: [8.3, 8.4]
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Setup PHP
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: ${{ matrix.php }}
41+
extensions: pdo, sqlite, imagick
42+
coverage: none
43+
- uses: ramsey/composer-install@v3
44+
- name: Run test suite
45+
run: |
46+
php vendor/bin/codecept build
47+
php vendor/bin/codecept run
48+
release:
49+
name: Automated release
50+
needs:
51+
- static_analysis
52+
- tests
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 0
58+
persist-credentials: false
59+
- uses: actions/setup-node@v4
60+
with:
61+
node-version: 22
62+
- run: >
63+
npx
64+
-p "@semantic-release/commit-analyzer"
65+
-p "@semantic-release/release-notes-generator"
66+
-p conventional-changelog-conventionalcommits
67+
-p semantic-release
68+
-- semantic-release --dry-run
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
permissions:
72+
packages: write
73+
contents: write
74+
pull-requests: write

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
tests/_support
66
tests/_output
77
tests/cases/yii2-app-advanced/_data/db.sqlite
8+
.php-cs-fixer.cache
9+
.ecs-cache

.releaserc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"branches": ["master"],
3+
"plugins": [
4+
["@semantic-release/commit-analyzer", {
5+
"preset": "conventionalcommits",
6+
"presetConfig": {}
7+
}],
8+
"@semantic-release/github",
9+
"@semantic-release/release-notes-generator"]
10+
}

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626
"yiisoft/yii2": "dev-master",
2727
"yiisoft/yii2-app-advanced": "dev-master",
2828
"codeception/verify": "^3.0",
29-
"codemix/yii2-localeurls": "^1.7",
3029
"codeception/module-asserts": ">= 3.0",
3130
"codeception/module-filesystem": "> 3.0",
3231
"phpstan/phpstan": "^2",
33-
"rector/rector": "^2"
32+
"symplify/easy-coding-standard": "^12.5"
3433
},
3534
"autoload":{
3635
"classmap": ["src/"]

ecs.php

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
// ecs.php
6+
use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\ForbiddenFunctionsSniff;
7+
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
8+
use PhpCsFixer\Fixer\ClassNotation\FinalInternalClassFixer;
9+
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
10+
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
11+
use PhpCsFixer\Fixer\Phpdoc\GeneralPhpdocAnnotationRemoveFixer;
12+
use PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer;
13+
use PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer;
14+
use PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer;
15+
use PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer;
16+
use Symplify\EasyCodingStandard\Config\ECSConfig;
17+
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
18+
19+
return static function (ECSConfig $ecsConfig): void {
20+
// Parallel
21+
$ecsConfig->parallel();
22+
23+
$ecsConfig->cacheDirectory('.ecs-cache');
24+
// Paths
25+
$ecsConfig->paths([
26+
__DIR__ . '/src', __DIR__ . '/tests', __DIR__ . '/ecs.php'
27+
]);
28+
29+
// A. full sets
30+
$ecsConfig->sets([SetList::PSR_12, SetList::SPACES, SetList::STRICT, SetList::DOCBLOCK]);
31+
32+
$ecsConfig->rule(NotOperatorWithSuccessorSpaceFixer::class);
33+
$ecsConfig->rule(ArraySyntaxFixer::class);
34+
$ecsConfig->ruleWithConfiguration(GeneralPhpdocAnnotationRemoveFixer::class, [
35+
'annotations' => ['author', 'inheritdoc', 'package']
36+
]);
37+
$ecsConfig->rule(NoBlankLinesAfterPhpdocFixer::class);
38+
$ecsConfig->ruleWithConfiguration(NoSuperfluousPhpdocTagsFixer::class, [
39+
'allow_mixed' => true
40+
]);
41+
$ecsConfig->rule(NoEmptyPhpdocFixer::class);
42+
$ecsConfig->rule(NoUnusedImportsFixer::class);
43+
$ecsConfig->ruleWithConfiguration(FinalInternalClassFixer::class, [
44+
'annotation_exclude' => ['@not-fix', '@internal'],
45+
'annotation_include' => [],
46+
'consider_absent_docblock_as_internal_class' => true
47+
]);
48+
$ecsConfig->ruleWithConfiguration(ForbiddenFunctionsSniff::class, [
49+
'forbiddenFunctions' => [
50+
'passthru' => null,
51+
'var_dump' => null,
52+
]
53+
]);
54+
$ecsConfig->rule(PhpdocIndentFixer::class);
55+
$ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\AlignMultilineCommentFixer::class);
56+
57+
$ecsConfig->skip([
58+
ForbiddenFunctionsSniff::class => [
59+
'tests/**',
60+
'console/**'
61+
]
62+
]);
63+
64+
// $ecsConfig->skip([
65+
// FinalClassFixer::class => [
66+
// 'tests/**'
67+
// ]
68+
// ]);
69+
};

0 commit comments

Comments
 (0)