Skip to content

Commit aa0196e

Browse files
authored
Merge pull request #1 from php-etl/feature/qualityflow-improvments
split phpstan actions, cs fixer for php 8, add compatibility php 8.2
2 parents 4dda534 + 5aa5f62 commit aa0196e

23 files changed

+203
-58
lines changed

.github/workflows/actions.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/phpstan5.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 5
2+
on: push
3+
jobs:
4+
phpstan5:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
9+
with:
10+
path: '**/vendor'
11+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
12+
restore-keys: |
13+
${{ runner.os }}-composer-
14+
- uses: php-actions/composer@v6
15+
with:
16+
args: '--prefer-dist'
17+
php_version: '8.2'
18+
- name: PHPStan
19+
uses: php-actions/phpstan@v3
20+
with:
21+
path: src/
22+
level: 5
23+
php_version: '8.2'

.github/workflows/phpstan6.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 6
2+
on: push
3+
jobs:
4+
phpstan6:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
9+
with:
10+
path: '**/vendor'
11+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
12+
restore-keys: |
13+
${{ runner.os }}-composer-
14+
- uses: php-actions/composer@v6
15+
with:
16+
args: '--prefer-dist'
17+
php_version: '8.2'
18+
- name: PHPStan
19+
uses: php-actions/phpstan@v3
20+
with:
21+
path: src/
22+
level: 6
23+
php_version: '8.2'

.github/workflows/phpstan7.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 7
2+
on: push
3+
jobs:
4+
phpstan7:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
9+
with:
10+
path: '**/vendor'
11+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
12+
restore-keys: |
13+
${{ runner.os }}-composer-
14+
- uses: php-actions/composer@v6
15+
with:
16+
args: '--prefer-dist'
17+
php_version: '8.2'
18+
- name: PHPStan
19+
uses: php-actions/phpstan@v3
20+
with:
21+
path: src/
22+
level: 7
23+
php_version: '8.2'

.github/workflows/phpstan8.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PHPStan level 8
2+
on: push
3+
jobs:
4+
phpstan8:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
9+
with:
10+
path: '**/vendor'
11+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
12+
restore-keys: |
13+
${{ runner.os }}-composer-
14+
- uses: php-actions/composer@v6
15+
with:
16+
args: '--prefer-dist'
17+
php_version: '8.2'
18+
- name: PHPStan
19+
uses: php-actions/phpstan@v3
20+
with:
21+
path: src/
22+
level: 8
23+
php_version: '8.2'

.github/workflows/quality.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Quality
2+
on: push
3+
jobs:
4+
cs-fixer:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- name: Cs-Fixer
9+
run: |
10+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
11+
chmod a+x php-cs-fixer
12+
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run

.github/workflows/rector.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# github action that checks code with Rector
2+
name: Rector
3+
4+
on: pull_request
5+
6+
jobs:
7+
rector:
8+
# Don't run on forks.
9+
if: github.repository == 'php-etl/metadata-contracts'
10+
runs-on: ubuntu-latest
11+
steps:
12+
# workaround for missing secret in fork PRs - see https://github.com/actions/checkout/issues/298
13+
# see https://github.com/rectorphp/rector/commit/d395e1c28b8e6a56711dcc2e10490a82965850e4
14+
-
15+
if: github.event.pull_request.head.repo.full_name == github.repository
16+
uses: actions/checkout@v3
17+
with:
18+
# Must be used to trigger workflow after push
19+
token: ${{ secrets.ACCESS_TOKEN }}
20+
21+
# in forks, the token is not available - so we cannot use it
22+
-
23+
if: github.event.pull_request.head.repo.full_name != github.repository
24+
uses: actions/checkout@v3
25+
26+
-
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: 8.2
30+
coverage: none
31+
32+
- uses: "ramsey/composer-install@v2"
33+
34+
- run: bin/rector --ansi
35+
36+
-
37+
# commit only to core contributors who have repository access
38+
if: github.event.pull_request.head.repo.full_name == github.repository
39+
uses: stefanzweifel/git-auto-commit-action@v4
40+
with:
41+
commit_message: '[rector] Rector fixes'
42+
commit_author: 'GitHub Action <[email protected]>'
43+
commit_user_email: '[email protected]'

.github/workflows/rector.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor/
2+
bin/
3+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
return (new PhpCsFixer\Config())
88
->setRiskyAllowed(true)
99
->setRules([
10+
'@PHP82Migration' => true,
1011
'@PHP81Migration' => true,
1112
'@PHP80Migration:risky' => true,
1213
'@PHPUnit84Migration:risky' => true,

0 commit comments

Comments
 (0)