Skip to content

Commit ca260a4

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 3a95162 commit ca260a4

File tree

13 files changed

+4193
-234
lines changed

13 files changed

+4193
-234
lines changed

.github/workflows/infection.yaml

Lines changed: 8 additions & 8 deletions
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

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

.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: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,67 @@
1-
name: Quality
1+
name: Quality (PHPStan lvl 5)
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
1419
phpunit:
1520
runs-on: ubuntu-latest
1621
steps:
17-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
1823
- uses: shivammathur/setup-php@v2
1924
with:
20-
php-version: '8.0'
25+
php-version: '8.2'
2126
tools: composer:v2
2227
coverage: pcov
23-
- uses: actions/cache@v2
28+
- uses: actions/cache@v3
2429
with:
2530
path: '**/vendor'
2631
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
2732
restore-keys: |
2833
${{ runner.os }}-composer-
29-
- uses: php-actions/composer@v5
34+
- uses: php-actions/composer@v6
3035
with:
3136
args: --prefer-dist
32-
php_version: 8.0
37+
php_version: '8.2'
3338

3439
- name: Run tests & generate Coverage
3540
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src
3641

3742
- name: Store coverage files
38-
uses: actions/upload-artifact@v2
43+
uses: actions/upload-artifact@v3
3944
with:
4045
path: var/coverage
4146

4247
phpstan:
4348
runs-on: ubuntu-latest
4449
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions/cache@v2
50+
- uses: actions/checkout@v3
51+
- uses: actions/cache@v3
4752
with:
4853
path: '**/vendor'
4954
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
5055
restore-keys: |
5156
${{ runner.os }}-composer-
52-
- uses: php-actions/composer@v5
57+
- uses: php-actions/composer@v6
5358
with:
5459
args: --prefer-dist
55-
php_version: 8.0
60+
php_version: '8.2'
5661

5762
- name: PHPStan
58-
uses: php-actions/phpstan@v2
63+
uses: php-actions/phpstan@v3
5964
with:
6065
path: src/
61-
args: --level=4
66+
level: 5
67+
php_version: '8.2'

.github/workflows/rector.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
if: github.event.pull_request.head.repo.full_name == github.repository
14+
uses: actions/checkout@v3
15+
with:
16+
# Must be used to trigger workflow after push
17+
token: ${{ secrets.ACCESS_TOKEN }}
18+
19+
-
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: 8.1
23+
coverage: none
24+
25+
- uses: "ramsey/composer-install@v2"
26+
27+
- run: bin/rector --ansi
28+
29+
-
30+
# commit only to core contributors who have repository access
31+
uses: stefanzweifel/git-auto-commit-action@v4
32+
with:
33+
commit_message: '[rector] Rector fixes'
34+
commit_author: 'GitHub Action <actions@github.com>'
35+
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

composer.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@
1616
"minimum-stability": "dev",
1717
"prefer-stable": true,
1818
"require": {
19-
"php": "^8.0",
19+
"php": "^8.2",
2020
"symfony/console": "^5.2",
21-
"php-etl/pipeline-contracts": "^0.3.0",
22-
"php-etl/console-state": "^0.1.0"
21+
"php-etl/pipeline-contracts": "^0.4@dev",
22+
"php-etl/console-state": "^0.2@dev"
23+
},
24+
"require-dev": {
25+
"phpstan/phpstan": "^1.10",
26+
"phpunit/phpunit": "^9.5 || ^10.0",
27+
"friendsofphp/php-cs-fixer": "^3.0",
28+
"infection/infection": "^0.26.18",
29+
"rector/rector": "^0.15"
2330
},
2431
"autoload": {
2532
"psr-4": {
@@ -32,11 +39,15 @@
3239
}
3340
},
3441
"config": {
35-
"bin-dir": "bin"
42+
"bin-dir": "bin",
43+
"allow-plugins": {
44+
"infection/extension-installer": true
45+
}
3646
},
3747
"extra": {
3848
"branch-alias": {
39-
"dev-main": "0.1.x-dev"
49+
"dev-main": "0.2.x-dev",
50+
"dev-feature/qualityflow-imprrvments": "0.2.x-dev"
4051
}
4152
}
4253
}

0 commit comments

Comments
 (0)