Skip to content

Commit f60d6bf

Browse files
committed
Add a phpstan lvl 6, validate cs-fixer, validate phpstan lvl3, add rector action, upgrade php 8.2 with rector
1 parent 391247d commit f60d6bf

36 files changed

+3791
-1319
lines changed

.github/workflows/infection.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@ jobs:
44
infection:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v3
88
- uses: shivammathur/setup-php@v2
99
with:
10-
php-version: '8.0'
10+
php-version: '8.2'
1111
tools: composer:v2
1212
coverage: pcov
13-
- uses: actions/cache@v2
13+
- uses: actions/cache@v3
1414
with:
1515
path: '**/vendor'
1616
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1717
restore-keys: |
1818
${{ runner.os }}-composer-
19-
- uses: php-actions/composer@v5
19+
- uses: php-actions/composer@v6
2020
with:
2121
args: --prefer-dist
22-
php_version: 8.0
22+
php_version: '8.2'
2323

2424
- name: Infection
2525
run: |
26-
wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar
27-
wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar.asc
26+
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar
27+
wget -q https://github.com/infection/infection/releases/download/0.26.18/infection.phar.asc
2828
chmod +x infection.phar
2929
./infection.phar
3030
3131
- name: Store infection log
32-
uses: actions/upload-artifact@v2
32+
uses: actions/upload-artifact@v3
3333
with:
3434
path: infection.log

.github/workflows/phpstan-5.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ 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
- name: PHPStan
19-
uses: php-actions/phpstan@v2
19+
uses: php-actions/phpstan@v3
2020
with:
2121
path: src/
2222
level: 5
23-
php_version: 8.0
23+
php_version: '8.2'

.github/workflows/phpstan-6.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
- name: PHPStan
19+
uses: php-actions/phpstan@v3
20+
with:
21+
path: src/
22+
level: 6
23+
php_version: '8.2'

.github/workflows/phpstan-7.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ 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
- name: PHPStan
19-
uses: php-actions/phpstan@v2
19+
uses: php-actions/phpstan@v3
2020
with:
2121
path: src/
2222
level: 7
23-
php_version: 8.0
23+
php_version: '8.2'

.github/workflows/phpstan-8.yaml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ 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
- name: PHPStan
19-
uses: php-actions/phpstan@v2
19+
uses: php-actions/phpstan@v3
2020
with:
2121
path: src/
2222
level: 8
23-
php_version: 8.0
23+
php_version: '8.2'

.github/workflows/phpunit.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: PHPUnit
2+
on: push
3+
jobs:
4+
phpunit:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: shivammathur/setup-php@v2
9+
with:
10+
php-version: '8.2'
11+
tools: composer:v2
12+
coverage: pcov
13+
- uses: actions/cache@v3
14+
with:
15+
path: '**/vendor'
16+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
17+
restore-keys: |
18+
${{ runner.os }}-composer-
19+
- uses: php-actions/composer@v6
20+
with:
21+
args: --prefer-dist
22+
php_version: '8.2'
23+
24+
- name: Run tests & generate Coverage
25+
run: bin/phpunit --coverage-html var/coverage
26+
27+
- name: Store coverage files
28+
uses: actions/upload-artifact@v3
29+
with:
30+
path: var/coverage

.github/workflows/quality.yaml

+14-36
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,37 @@
1-
name: Quality (PHPStan level 4)
1+
name: Quality (PHPStan level 3)
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+
coverage: none
812
- name: Cs-Fixer
913
run: |
10-
wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
14+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
1115
chmod a+x php-cs-fixer
1216
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
1317
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-
- name: Run tests & generate Coverage
34-
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src
35-
- name: Store coverage files
36-
uses: actions/upload-artifact@v2
37-
with:
38-
path: var/coverage
39-
4018
phpstan:
4119
runs-on: ubuntu-latest
4220
steps:
43-
- uses: actions/checkout@v2
44-
- uses: actions/cache@v2
21+
- uses: actions/checkout@v3
22+
- uses: actions/cache@v3
4523
with:
4624
path: '**/vendor'
4725
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
4826
restore-keys: |
4927
${{ runner.os }}-composer-
50-
- uses: php-actions/composer@v5
28+
- uses: php-actions/composer@v6
5129
with:
5230
args: --prefer-dist
53-
php_version: 8.0
31+
php_version: '8.2'
5432
- name: PHPStan
55-
uses: php-actions/phpstan@v2
33+
uses: php-actions/phpstan@v3
5634
with:
5735
path: src/
58-
level: 4
59-
php_version: 8.0
36+
level: 3
37+
php_version: '8.2'

.github/workflows/rector.yaml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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'
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: '8.2'
17+
coverage: none
18+
19+
- uses: "ramsey/composer-install@v2"
20+
21+
- run: bin/rector --ansi
22+
23+
- # commit only to core contributors who have repository access
24+
if: github.event.pull_request.head.repo.full_name == github.repository
25+
uses: stefanzweifel/git-auto-commit-action@v4
26+
with:
27+
commit_message: '[rector] Rector fixes'
28+
commit_author: 'GitHub Action <[email protected]>'
29+
commit_user_email: '[email protected]'

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
.idea/
22
vendor/
3+
bin/
4+
.php-cs-fixer.cache
5+
.phpunit.result.cache

.php-cs-fixer.dist.php

+1
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,

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ with logging, line rejections and execution states.
66

77

88
[![Quality](https://github.com/php-etl/pipeline/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/pipeline/actions/workflows/quality.yaml)
9+
[![PHPUnit](https://github.com/php-etl/pipeline/actions/workflows/phpunit.yaml/badge.svg)](https://github.com/php-etl/pipeline/actions/workflows/phpunit.yaml)
10+
[![Mutations](https://github.com/php-etl/pipeline/actions/workflows/infection.yaml/badge.svg)](https://github.com/php-etl/pipeline/actions/workflows/infection.yaml)
911
[![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)
12+
[![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)
1013
[![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)
1114
[![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)
1215
![PHP](https://img.shields.io/packagist/php-v/php-etl/pipeline)

composer.json

+15-10
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@
1616
"minimum-stability": "dev",
1717
"prefer-stable": true,
1818
"require": {
19-
"php": "^8.0",
19+
"php": "^8.2",
2020
"psr/log": "^1.1",
21-
"php-etl/bucket": "^0.2.0",
22-
"php-etl/pipeline-contracts": "^0.3.0",
23-
"php-etl/bucket-contracts": "^0.1.0"
21+
"php-etl/bucket": "^0.3.0",
22+
"php-etl/pipeline-contracts": "^0.4.0",
23+
"php-etl/bucket-contracts": "^0.2.0"
2424
},
2525
"require-dev": {
26-
"phpunit/phpunit": "^9.0",
27-
"johnkary/phpunit-speedtrap": "*",
28-
"mybuilder/phpunit-accelerator": "*",
29-
"phpunit/php-invoker": "*"
26+
"phpunit/php-invoker": "^4.0",
27+
"phpstan/phpstan": "^1.10",
28+
"phpunit/phpunit": "^10.0",
29+
"friendsofphp/php-cs-fixer": "^3.0",
30+
"infection/infection": "^0.26.18",
31+
"rector/rector": "^0.15"
3032
},
3133
"provide": {
3234
"php-etl/pipeline-implementation": "0.3.0"
@@ -42,11 +44,14 @@
4244
}
4345
},
4446
"config": {
45-
"bin-dir": "bin"
47+
"bin-dir": "bin",
48+
"allow-plugins": {
49+
"infection/extension-installer": true
50+
}
4651
},
4752
"extra": {
4853
"branch-alias": {
49-
"dev-main": "0.4.x-dev"
54+
"dev-main": "0.5.x-dev"
5055
}
5156
}
5257
}

0 commit comments

Comments
 (0)