Skip to content

Commit ec54a6b

Browse files
committed
combine paths
1 parent 2192356 commit ec54a6b

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

.github/workflows/test-rector.yml

Lines changed: 6 additions & 11 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: ['7.4', '8.0']
49-
paths:
50-
- app
51-
- system
52-
- tests
53-
- utils
5449
steps:
5550
- name: Checkout
5651
uses: actions/checkout@v4
@@ -83,11 +78,11 @@ jobs:
8378
- name: Rector Cache
8479
uses: actions/cache@v4
8580
with:
86-
path: /tmp/rector-${{ matrix.paths }}
87-
key: ${{ runner.os }}-rector-${{ matrix.paths }}-${{ github.run_id }}
88-
restore-keys: ${{ runner.os }}-rector-${{ matrix.paths }}-
81+
path: /tmp/rector
82+
key: ${{ runner.os }}-rector-${{ github.run_id }}
83+
restore-keys: ${{ runner.os }}-rector-
8984

90-
- run: mkdir -p /tmp/rector-${{ matrix.paths }}
85+
- run: mkdir -p /tmp/rector
9186

9287
- name: Run static analysis
93-
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: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,8 @@
6565

6666
// Github action cache
6767
$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('/tmp/rector-' . $_SERVER['argv'][2]);
68+
if (is_dir('/tmp')) {
69+
$rectorConfig->cacheDirectory('/tmp/rector');
7470
}
7571

7672
// paths to refactor; solid alternative to CLI arguments

0 commit comments

Comments
 (0)