Skip to content

Commit

Permalink
qa: improve cache and performances of Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
romm committed Aug 31, 2022
1 parent 3c4d299 commit bf7af18
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
env:
php-version: '8.1'
php-extensions: xdebug, yaml
php-extensions: pcov, yaml
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -29,6 +29,12 @@ jobs:
- name: Creating var directory
run: mkdir -p var/cache

- name: Cache Mutation results
uses: actions/[email protected]
with:
path: var/cache
key: ${{ runner.os }}-qa-${{ hashFiles('composer.lock') }}-${{ hashFiles('.github/workflows/mutation.yml') }}

- name: Running mutation tests
if: github.ref == 'refs/heads/master'
run: php vendor/bin/infection --threads=$(nproc)
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/quality-assurance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
env:
php-version: '8.1'
php-extensions: xdebug, yaml
php-extensions: yaml
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -18,18 +18,18 @@ jobs:
extensions: ${{ env.php-extensions }}
ini-values: zend.assertions=1

- name: Creating var directory
run: mkdir -p var/cache

- name: Cache QA results
uses: actions/[email protected]
with:
path: var/cache
key: qa-${{ hashFiles('composer.lock') }}
key: ${{ runner.os }}-qa-${{ hashFiles('composer.lock') }}-${{ hashFiles('.github/workflows/quality-assurance.yml') }}

- name: Checking Composer
run: composer validate --strict

- name: Creating var directory
run: mkdir -p var/cache

- uses: "ramsey/composer-install@v2"

- name: Running PHPStan
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- "8.1"

env:
php-extensions: xdebug, yaml
php-extensions: yaml
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
6 changes: 5 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\Config\RectorConfig;
use Rector\Core\Configuration\Option;
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
Expand All @@ -14,7 +15,10 @@
__DIR__ . '/tests',
]);

$config->parameters()->set(Option::CACHE_DIR, 'var/cache/rector');
$config->parameters()->set(Option::CACHE_DIR, './var/cache/rector');

// @see https://github.com/rectorphp/rector/issues/7341
$config->parameters()->set(Option::CACHE_CLASS, FileCacheStorage::class);

$config->sets([
LevelSetList::UP_TO_PHP_74,
Expand Down

0 comments on commit bf7af18

Please sign in to comment.