Skip to content

Commit 98a671e

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.5
Conflicts: .github/workflows/test-rector.yml
2 parents cc01dd2 + f82dc32 commit 98a671e

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

.github/workflows/test-rector.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,12 @@ permissions:
4040

4141
jobs:
4242
build:
43-
name: PHP ${{ matrix.php-versions }} Analyze code (Rector) on ${{ matrix.paths }}
43+
name: PHP ${{ matrix.php-versions }} Analyze code (Rector)
4444
runs-on: ubuntu-22.04
4545
strategy:
4646
fail-fast: false
4747
matrix:
4848
php-versions: ['8.1', '8.3']
49-
paths:
50-
- app
51-
- system
52-
- tests
53-
- utils
5449
steps:
5550
- name: Checkout
5651
uses: actions/checkout@v4
@@ -80,5 +75,14 @@ jobs:
8075
- name: Install dependencies
8176
run: composer update --ansi --no-interaction
8277

78+
- name: Rector Cache
79+
uses: actions/cache@v4
80+
with:
81+
path: /tmp/rector
82+
key: ${{ runner.os }}-rector-${{ github.run_id }}
83+
restore-keys: ${{ runner.os }}-rector-
84+
85+
- run: mkdir -p /tmp/rector
86+
8387
- name: Run static analysis
84-
run: vendor/bin/rector process ${{ matrix.paths }} --dry-run --no-progress-bar
88+
run: vendor/bin/rector process --dry-run --no-progress-bar

rector.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* the LICENSE file that was distributed with this source code.
1212
*/
1313

14+
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
1415
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
1516
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
1617
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
@@ -71,6 +72,12 @@
7172

7273
$rectorConfig->parallel(120, 8, 10);
7374

75+
// Github action cache
76+
$rectorConfig->cacheClass(FileCacheStorage::class);
77+
if (is_dir('/tmp')) {
78+
$rectorConfig->cacheDirectory('/tmp/rector');
79+
}
80+
7481
// paths to refactor; solid alternative to CLI arguments
7582
$rectorConfig->paths([__DIR__ . '/app', __DIR__ . '/system', __DIR__ . '/tests', __DIR__ . '/utils']);
7683

0 commit comments

Comments
 (0)