Skip to content

Commit b762262

Browse files
authored
Merge pull request #9 from php-etl/feature/qualityflow-improvments
update actions, add a rector action, add a php cs fixer config file, …
2 parents 8e47984 + 5c7fd07 commit b762262

39 files changed

+3533
-1035
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.1'
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.1
22+
php_version: '8.2'
2323

2424
- name: Infection
2525
run: |
26-
wget -q https://github.com/infection/infection/releases/download/0.26.10/infection.phar
27-
wget -q https://github.com/infection/infection/releases/download/0.26.10/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: 7 additions & 7 deletions
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.1
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/
22-
args: --level=5
23-
php_version: 8.1
22+
level: 5
23+
php_version: '8.2'

.github/workflows/phpstan-6.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+
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

Lines changed: 7 additions & 7 deletions
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.1
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/
22-
args: --level=7
23-
php_version: 8.1
22+
level: 7
23+
php_version: '8.2'

.github/workflows/phpstan-8.yaml

Lines changed: 7 additions & 7 deletions
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.1
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/
22-
args: --level=8
23-
php_version: 8.1
22+
level: 8
23+
php_version: '8.2'

.github/workflows/phpunit.yaml

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

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,35 @@ 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: |
1014
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.1'
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.1
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.1
31+
php_version: '8.2'
5432

5533
- name: PHPStan
56-
uses: php-actions/phpstan@v2
34+
uses: php-actions/phpstan@v3
5735
with:
5836
path: src/
59-
args: --level=4
60-
php_version: 8.1
37+
level: 3
38+
php_version: '8.2'

.github/workflows/rector.yaml

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

.gitignore

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

.php-cs-fixer.dist.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
$finder = (new PhpCsFixer\Finder())
4+
->in('src')
5+
;
6+
7+
return (new PhpCsFixer\Config())
8+
->setRiskyAllowed(true)
9+
->setRules([
10+
'@PHP82Migration' => true,
11+
'@PHP81Migration' => true,
12+
'@PHP80Migration:risky' => true,
13+
'@PHPUnit84Migration:risky' => true,
14+
'@PSR1' => true,
15+
'@PSR12' => true,
16+
'@PhpCsFixer' => true,
17+
'@Symfony' => true,
18+
'ternary_to_elvis_operator' => true,
19+
'set_type_to_cast' => true,
20+
'self_accessor' => true,
21+
'psr_autoloading' => true,
22+
'php_unit_test_annotation' => ['style' => 'annotation'],
23+
'php_unit_set_up_tear_down_visibility' => true,
24+
'php_unit_construct' => true,
25+
'no_useless_sprintf' => true,
26+
'no_homoglyph_names' => true,
27+
'native_function_invocation' => true,
28+
'native_constant_invocation' => true,
29+
'modernize_types_casting' => true,
30+
'logical_operators' => true,
31+
'is_null' => true,
32+
'function_to_constant' => true,
33+
'fopen_flag_order' => true,
34+
'error_suppression' => true,
35+
'ereg_to_preg' => true,
36+
'dir_constant' => true,
37+
'method_chaining_indentation' => false,
38+
])
39+
->setFinder($finder)
40+
->setCacheFile('.php-cs-fixer.cache') // forward compatibility with 3.x line
41+
;

composer.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@
33
"description": "Extension for testing FastMap and ETL components with PHPUnit testing framework",
44
"type": "library",
55
"require": {
6-
"php": "^8.1",
7-
"phpunit/phpunit": "^9",
6+
"php": "^8.2",
7+
"phpunit/phpunit": "^10.0",
88
"nikic/php-parser": "^4.10",
9-
"php-etl/pipeline-contracts": "^0.3.0",
9+
"php-etl/pipeline-contracts": "^0.4.0",
1010
"php-http/message": "^1.11",
1111
"php-http/mock-client": "^1.4@dev",
1212
"fakerphp/faker": "^1.19",
1313
"laminas/laminas-diactoros": "^2.6",
1414
"mikey179/vfsstream": "^1.6"
1515
},
16+
"require-dev": {
17+
"phpstan/phpstan": "^1.10",
18+
"friendsofphp/php-cs-fixer": "^3.0",
19+
"infection/infection": "^0.26.18",
20+
"rector/rector": "^0.15"
21+
},
1622
"license": "MIT",
1723
"authors": [
1824
{
@@ -33,11 +39,15 @@
3339
}
3440
},
3541
"config": {
36-
"bin-dir": "bin"
42+
"bin-dir": "bin",
43+
"allow-plugins": {
44+
"php-http/discovery": true,
45+
"infection/extension-installer": true
46+
}
3747
},
3848
"extra": {
3949
"branch-alias": {
40-
"dev-main": "0.4.x-dev"
50+
"dev-main": "0.5.x-dev"
4151
}
4252
}
4353
}

0 commit comments

Comments
 (0)