Skip to content

Commit f304d95

Browse files
committed
set cache directory
1 parent 4a5b556 commit f304d95

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

rector.php

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

12+
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
1213
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
1314
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
1415
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
@@ -62,6 +63,16 @@
6263

6364
$rectorConfig->parallel(120, 8, 10);
6465

66+
// Github action cache
67+
$rectorConfig->cacheClass(FileCacheStorage::class);
68+
69+
if (isset($_SERVER['argv'][2])
70+
&& in_array($_SERVER['argv'][2], ['app', 'system', 'tests', 'utils'], true)
71+
&& is_dir('/tmp/rector-' . $_SERVER['argv'][2])
72+
) {
73+
$rectorConfig->cacheDirectory($_SERVER['argv'][2]);
74+
}
75+
6576
// paths to refactor; solid alternative to CLI arguments
6677
$rectorConfig->paths([__DIR__ . '/app', __DIR__ . '/system', __DIR__ . '/tests', __DIR__ . '/utils']);
6778

0 commit comments

Comments
 (0)