Skip to content

Commit

Permalink
Enable MemoryCacheStorage in more CI setups (#1853)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandoorn committed Feb 21, 2022
1 parent 710e77b commit b765bdb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config/parameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -39,8 +40,8 @@

// 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);
}
};

0 comments on commit b765bdb

Please sign in to comment.