Skip to content

Refactor workflows #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,11 @@ jobs:
- name: Update composer.
run: composer self-update

- name: Set environment variables pull request linux.
uses: yiisoft/actions/db/environment-linux@master

- name: Install db.
uses: yiisoft/actions/db/subpackage-install@master
uses: yiisoft/actions/install-packages@master
with:
BRANCH_NAME: ${{ env.BRANCH_NAME }}
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
CURRENT_PACKAGE: db
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
packages: >-
['db']

- name: Run tests with phpunit with code coverage.
run: vendor/bin/phpunit --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations
Expand Down
53 changes: 8 additions & 45 deletions .github/workflows/composer-require-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
- 'src/**'
- '.github/workflows/composer-require-checker.yml'
- 'composer.json'
- 'composer-require-checker.json'

push:
branches: ['master']
paths:
- 'src/**'
- '.github/workflows/composer-require-checker.yml'
- 'composer.json'
- 'composer-require-checker.json'

name: Composer require checker

Expand All @@ -20,48 +22,9 @@ concurrency:

jobs:
composer-require-checker:
name: PHP ${{ matrix.php }}

env:
COMPOSER_ROOT_VERSION: 1.0.0

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest

php:
- 8.1
- 8.2
- 8.3
- 8.4

steps:
- name: Checkout.
uses: actions/checkout@v4

- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none

- name: Update composer.
run: composer self-update

- name: Set environment variables pull request linux.
uses: yiisoft/actions/db/environment-linux@master

- name: Install db.
uses: yiisoft/actions/db/subpackage-install@master
with:
BRANCH_NAME: ${{ env.BRANCH_NAME }}
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
CURRENT_PACKAGE: db
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}

- name: Check dependencies.
run: vendor/bin/composer-require-checker
uses: yiisoft/actions/.github/workflows/composer-require-checker.yml@master
with:
php: >-
['8.1', '8.2', '8.3', '8.4']
required-packages: >-
['db']
12 changes: 3 additions & 9 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,11 @@ jobs:
ini-values: memory_limit=-1
coverage: pcov

- name: Set environment variables pull request linux.
uses: yiisoft/actions/db/environment-linux@master

- name: Install db.
uses: yiisoft/actions/db/subpackage-install@master
uses: yiisoft/actions/install-packages@master
with:
BRANCH_NAME: ${{ env.BRANCH_NAME }}
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
CURRENT_PACKAGE: db
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}
packages: >-
['db']

- name: Run infection.
run: |
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
on:
pull_request:
pull_request_target:
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/rector.yml'
- 'composer.json'
- 'rector.php'

name: rector
name: Rector

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -15,8 +16,11 @@ concurrency:
jobs:
rector:
uses: yiisoft/actions/.github/workflows/rector.yml@master
secrets:
token: ${{ secrets.YIISOFT_GITHUB_TOKEN }}
with:
os: >-
['ubuntu-latest']
repository: ${{ github.event.pull_request.head.repo.full_name }}
php: >-
['8.4']
required-packages: >-
['db']
54 changes: 7 additions & 47 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,17 @@ on:
- 'psalm*.xml'
- 'composer.json'

name: static analysis
name: Static analysis

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
psalm:
name: PHP ${{ matrix.php }}

env:
COMPOSER_ROOT_VERSION: 1.0.0

runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-latest

php:
- 8.1
- 8.2
- 8.3
- 8.4

steps:
- name: Checkout.
uses: actions/checkout@v4

- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: cs2pr

- name: Update composer.
run: composer self-update

- name: Set environment variables pull request linux.
uses: yiisoft/actions/db/environment-linux@master

- name: Install db.
uses: yiisoft/actions/db/subpackage-install@master
with:
BRANCH_NAME: ${{ env.BRANCH_NAME }}
COMPOSER_ROOT_VERSION: ${{ env.COMPOSER_ROOT_VERSION }}
CURRENT_PACKAGE: db
FULL_BRANCH_NAME: ${{ env.FULL_BRANCH_NAME }}
WORK_PACKAGE_URL: ${{ env.WORK_PACKAGE_URL }}

- name: Static analysis.
run: vendor/bin/psalm --config=${{ inputs.psalm-config }} --shepherd --stats --output-format=github --php-version=${{ matrix.php }}
uses: yiisoft/actions/.github/workflows/psalm.yml@master
with:
php: >-
['8.1', '8.2', '8.3', '8.4']
required-packages: >-
['db']
28 changes: 9 additions & 19 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,19 @@
use Rector\Php73\Rector\String_\SensitiveHereNowDocRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
/**
* Disabled ./tests directory due to different branches with main package when testing
*/
// __DIR__ . '/tests',
]);

// register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);

// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
]);

$rectorConfig->skip([
__DIR__ . '/tests',
])
->withPhpSets(php81: true)
->withRules([
InlineConstructorDefaultToPropertyRector::class,
])
->withSkip([
NullToStrictStringFuncCallArgRector::class,
ReadOnlyPropertyRector::class,
SensitiveHereNowDocRector::class,
RemoveParentCallWithoutParentRector::class,
]);
};
Loading