Skip to content

Commit 29cbb72

Browse files
authored
Merge pull request #1 from php-etl/feature/qualityflow-imprrvments
Add a phpstan lvl 6, validate cs-fixer, validate phpstan lvl3, add re…
2 parents 3a95162 + 1a8436c commit 29cbb72

File tree

14 files changed

+1729
-360
lines changed

14 files changed

+1729
-360
lines changed

.github/workflows/infection.yaml

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

.github/workflows/phpstan-5.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ jobs:
44
phpstan:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/cache@v2
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
99
with:
1010
path: '**/vendor'
1111
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1212
restore-keys: |
1313
${{ runner.os }}-composer-
14-
- uses: php-actions/composer@v5
14+
- uses: php-actions/composer@v6
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: '8.2'
1818

19-
- name: PHPStan
20-
uses: php-actions/phpstan@v2
21-
with:
22-
path: src/
23-
args: --level=5
19+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 5
24+
php_version: '8.2'

.github/workflows/phpstan-6.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PHPStan level 6
2+
on: push
3+
jobs:
4+
phpstan:
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+
19+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 6
24+
php_version: '8.2'

.github/workflows/phpstan-7.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ jobs:
44
phpstan:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/cache@v2
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
99
with:
1010
path: '**/vendor'
1111
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1212
restore-keys: |
1313
${{ runner.os }}-composer-
14-
- uses: php-actions/composer@v5
14+
- uses: php-actions/composer@v6
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: '8.2'
1818

19-
- name: PHPStan
20-
uses: php-actions/phpstan@v2
21-
with:
22-
path: src/
23-
args: --level=5
19+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 7
24+
php_version: '8.2'

.github/workflows/phpstan-8.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@ jobs:
44
phpstan:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/cache@v2
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
99
with:
1010
path: '**/vendor'
1111
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1212
restore-keys: |
1313
${{ runner.os }}-composer-
14-
- uses: php-actions/composer@v5
14+
- uses: php-actions/composer@v6
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: '8.2'
1818

19-
- name: PHPStan
20-
uses: php-actions/phpstan@v2
21-
with:
22-
path: src/
23-
args: --level=5
19+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 8
24+
php_version: '8.2'

.github/workflows/quality.yaml

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,39 @@
1-
name: Quality
1+
name: Quality (PHPStan lvl 4)
22
on: push
33
jobs:
44
cs-fixer:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v3
8+
- uses: shivammathur/setup-php@v2
9+
with:
10+
php-version: '8.2'
11+
tools: composer:v2
12+
coverage: none
813
- name: Cs-Fixer
914
run: |
10-
wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
15+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
1116
chmod a+x php-cs-fixer
1217
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
1318
14-
phpunit:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v2
18-
- uses: shivammathur/setup-php@v2
19-
with:
20-
php-version: '8.0'
21-
tools: composer:v2
22-
coverage: pcov
23-
- uses: actions/cache@v2
24-
with:
25-
path: '**/vendor'
26-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
27-
restore-keys: |
28-
${{ runner.os }}-composer-
29-
- uses: php-actions/composer@v5
30-
with:
31-
args: --prefer-dist
32-
php_version: 8.0
33-
34-
- name: Run tests & generate Coverage
35-
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src
36-
37-
- name: Store coverage files
38-
uses: actions/upload-artifact@v2
39-
with:
40-
path: var/coverage
41-
4219
phpstan:
4320
runs-on: ubuntu-latest
4421
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions/cache@v2
22+
- uses: actions/checkout@v3
23+
- uses: actions/cache@v3
4724
with:
4825
path: '**/vendor'
4926
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
5027
restore-keys: |
5128
${{ runner.os }}-composer-
52-
- uses: php-actions/composer@v5
29+
- uses: php-actions/composer@v6
5330
with:
5431
args: --prefer-dist
55-
php_version: 8.0
32+
php_version: '8.2'
5633

5734
- name: PHPStan
58-
uses: php-actions/phpstan@v2
35+
uses: php-actions/phpstan@v3
5936
with:
6037
path: src/
61-
args: --level=4
38+
level: 4
39+
php_version: '8.2'

.github/workflows/rector.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# github action that checks code with Rector
2+
name: Rector
3+
4+
on:
5+
pull_request: null
6+
7+
jobs:
8+
rector:
9+
runs-on: ubuntu-latest
10+
if: github.event.pull_request.head.repo.full_name == 'php-etl/pipeline-console-runtime'
11+
steps:
12+
-
13+
uses: actions/checkout@v3
14+
15+
-
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: '8.2'
19+
coverage: none
20+
21+
- uses: "ramsey/composer-install@v2"
22+
23+
- run: bin/rector --ansi
24+
25+
-
26+
# commit only to core contributors who have repository access
27+
if: github.event.pull_request.head.repo.full_name == github.repository
28+
uses: stefanzweifel/git-auto-commit-action@v4
29+
with:
30+
commit_message: '[rector] Rector fixes'
31+
commit_author: 'GitHub Action <actions@github.com>'
32+
commit_user_email: 'action@github.com'

.gitignore

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

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Pipeline Console Runtime
2+
===
3+
4+
5+
[![Quality](https://github.com/php-etl/pipeline/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/pipeline/actions/workflows/quality.yaml)
6+
[![PHPStan level 5](https://github.com/php-etl/pipeline/actions/workflows/phpstan-5.yaml/badge.svg)](https://github.com/php-etl/pipeline/actions/workflows/phpstan-5.yaml)
7+
[![PHPStan level 5](https://github.com/php-etl/pipeline/actions/workflows/phpstan-6.yaml/badge.svg)](https://github.com/php-etl/pipeline/actions/workflows/phpstan-6.yaml)
8+
[![PHPStan level 7](https://github.com/php-etl/pipeline/actions/workflows/phpstan-7.yaml/badge.svg)](https://github.com/php-etl/pipeline/actions/workflows/phpstan-7.yaml)
9+
[![PHPStan level 8](https://github.com/php-etl/pipeline/actions/workflows/phpstan-8.yaml/badge.svg)](https://github.com/php-etl/pipeline/actions/workflows/phpstan-8.yaml)
10+
![PHP](https://img.shields.io/packagist/php-v/php-etl/pipeline)

composer.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@
1616
"minimum-stability": "dev",
1717
"prefer-stable": true,
1818
"require": {
19-
"php": "^8.0",
20-
"symfony/console": "^5.2",
21-
"php-etl/pipeline-contracts": "^0.3.0",
22-
"php-etl/console-state": "^0.1.0"
19+
"php": "^8.2",
20+
"symfony/console": "^6.0",
21+
"php-etl/pipeline-contracts": "^0.4",
22+
"php-etl/console-state": "^0.2"
23+
},
24+
"require-dev": {
25+
"phpstan/phpstan": "^1.10",
26+
"friendsofphp/php-cs-fixer": "^3.0",
27+
"rector/rector": "^0.15"
2328
},
2429
"autoload": {
2530
"psr-4": {
@@ -36,7 +41,7 @@
3641
},
3742
"extra": {
3843
"branch-alias": {
39-
"dev-main": "0.1.x-dev"
44+
"dev-main": "0.2.x-dev"
4045
}
4146
}
4247
}

0 commit comments

Comments
 (0)