mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 08:50:50 +00:00
Enable MemoryCacheStorage in more CI setups (#1853)
This commit is contained in:
parent
710e77b2b8
commit
b765bdb683
|
@ -2,6 +2,7 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
use OndraM\CiDetector\CiDetector;
|
||||
use Rector\Caching\ValueObject\Storage\MemoryCacheStorage;
|
||||
use Rector\Core\Configuration\Option;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
@ -39,8 +40,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {
|
|||
|
||||
// use faster in-memory cache in CI.
|
||||
// CI always starts from scratch, therefore IO intensive caching is not worth it
|
||||
$runsInGithubAction = getenv('GITHUB_ACTION');
|
||||
if ($runsInGithubAction !== false) {
|
||||
$ciDetector = new CiDetector();
|
||||
if ($ciDetector->isCiDetected() !== false) {
|
||||
$parameters->set(Option::CACHE_CLASS, MemoryCacheStorage::class);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user