Skip to content

Commit 55735ec

Browse files
committed
Split github actions, Add a phpstan lvl 6, validate cs-fixer, validate phpstan lvl3, add rector action, upgrade php 8.2 with rector, update infection
1 parent f0e5833 commit 55735ec

39 files changed

+1770
-838
lines changed

.github/workflows/infection.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Mutations
2+
on: push
3+
jobs:
4+
infection:
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: Infection
25+
run: |
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
28+
chmod +x infection.phar
29+
./infection.phar
30+
31+
- name: Store infection log
32+
uses: actions/upload-artifact@v3
33+
with:
34+
path: infection.log

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

.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+
19+
- name: PHPStan
20+
uses: php-actions/phpstan@v3
21+
with:
22+
path: src/
23+
level: 6

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

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

.github/workflows/quality.yaml

Lines changed: 14 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ 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'
811
- name: Cs-Fixer
912
run: |
1013
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
@@ -14,143 +17,49 @@ jobs:
1417
phpunit:
1518
runs-on: ubuntu-latest
1619
steps:
17-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
1821
- uses: shivammathur/setup-php@v2
1922
with:
2023
php-version: '8.2'
2124
tools: composer:v2
2225
coverage: pcov
23-
- uses: actions/cache@v2
26+
- uses: actions/cache@v3
2427
with:
2528
path: '**/vendor'
2629
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
2730
restore-keys: |
2831
${{ runner.os }}-composer-
29-
- uses: php-actions/composer@v5
32+
- uses: php-actions/composer@v6
3033
with:
3134
args: --prefer-dist
32-
php_version: 8.2
35+
php_version: '8.2'
3336

3437
- name: Run tests & generate Coverage
3538
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src
3639

3740
- name: Store coverage files
38-
uses: actions/upload-artifact@v2
41+
uses: actions/upload-artifact@v3
3942
with:
4043
path: var/coverage
4144

4245
phpstan:
4346
runs-on: ubuntu-latest
4447
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions/cache@v2
48+
- uses: actions/checkout@v3
49+
- uses: actions/cache@v3
4750
with:
4851
path: '**/vendor'
4952
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
5053
restore-keys: |
5154
${{ runner.os }}-composer-
52-
- uses: php-actions/composer@v5
55+
- uses: php-actions/composer@v6
5356
with:
5457
args: --prefer-dist
55-
php_version: 8.2
58+
php_version: '8.2'
5659

5760
- name: PHPStan
58-
uses: php-actions/phpstan@v2
61+
uses: php-actions/phpstan@v3
5962
with:
6063
path: src/
6164
args: --level=4
6265

63-
phpstan5:
64-
runs-on: ubuntu-latest
65-
steps:
66-
- uses: actions/checkout@v2
67-
- uses: actions/cache@v2
68-
with:
69-
path: '**/vendor'
70-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
71-
restore-keys: |
72-
${{ runner.os }}-composer-
73-
- uses: php-actions/composer@v5
74-
with:
75-
args: --prefer-dist
76-
php_version: 8.2
77-
78-
- name: PHPStan
79-
uses: php-actions/phpstan@v2
80-
with:
81-
path: src/
82-
args: --level=5
83-
84-
phpstan7:
85-
runs-on: ubuntu-latest
86-
steps:
87-
- uses: actions/checkout@v2
88-
- uses: actions/cache@v2
89-
with:
90-
path: '**/vendor'
91-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
92-
restore-keys: |
93-
${{ runner.os }}-composer-
94-
- uses: php-actions/composer@v5
95-
with:
96-
args: --prefer-dist
97-
php_version: 8.2
98-
99-
- name: PHPStan
100-
uses: php-actions/phpstan@v2
101-
with:
102-
path: src/
103-
args: --level=7
104-
105-
phpstan8:
106-
runs-on: ubuntu-latest
107-
steps:
108-
- uses: actions/checkout@v2
109-
- uses: actions/cache@v2
110-
with:
111-
path: '**/vendor'
112-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
113-
restore-keys: |
114-
${{ runner.os }}-composer-
115-
- uses: php-actions/composer@v5
116-
with:
117-
args: --prefer-dist
118-
php_version: 8.2
119-
120-
- name: PHPStan
121-
uses: php-actions/phpstan@v2
122-
with:
123-
path: src/
124-
args: --level=8
125-
126-
infection:
127-
runs-on: ubuntu-latest
128-
steps:
129-
- uses: actions/checkout@v2
130-
- uses: shivammathur/setup-php@v2
131-
with:
132-
php-version: '8.2'
133-
tools: composer:v2
134-
coverage: pcov
135-
- uses: actions/cache@v2
136-
with:
137-
path: '**/vendor'
138-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
139-
restore-keys: |
140-
${{ runner.os }}-composer-
141-
- uses: php-actions/composer@v5
142-
with:
143-
args: --prefer-dist
144-
php_version: 8.2
145-
146-
- name: Infection
147-
run: |
148-
wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar
149-
wget -q https://github.com/infection/infection/releases/download/0.20.0/infection.phar.asc
150-
chmod +x infection.phar
151-
./infection.phar
152-
153-
- name: Store infection log
154-
uses: actions/upload-artifact@v2
155-
with:
156-
path: infection.log

.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/sql-plugin'
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.2'
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
/vendor
2+
bin/
3+
.php-cs-fixer.cache
4+
.phpunit.result.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,

composer.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"minimum-stability": "dev",
1313
"prefer-stable": true,
1414
"require": {
15-
"php": "^8.0",
15+
"php": "^8.2",
1616
"nikic/php-parser": "^4.10",
1717
"symfony/config": "^5.2",
1818
"symfony/expression-language": "^5.2",
@@ -25,10 +25,11 @@
2525
"phpunit/phpunit": "^9.5",
2626
"php-etl/phpunit-extension": "^0.4.0",
2727
"adlawson/vfs": "^0.12.1",
28-
"phpstan/phpstan": "^0.12.93",
28+
"phpstan/phpstan": "^1.10",
2929
"php-etl/sql-flow": "^0.1.0",
3030
"friendsofphp/php-cs-fixer": "^3.0",
31-
"mikey179/vfsstream": "^1.6"
31+
"mikey179/vfsstream": "^1.6",
32+
"rector/rector": "^0.15"
3233
},
3334
"autoload": {
3435
"psr-4": {
@@ -43,13 +44,16 @@
4344
},
4445
"extra": {
4546
"branch-alias": {
46-
"dev-main": "0.3.x-dev"
47+
"dev-main": "0.4.x-dev"
4748
},
4849
"gyroscops": {
4950
"plugins": ["Kiboko\\Plugin\\SQL\\Service"]
5051
}
5152
},
5253
"config": {
53-
"bin-dir": "bin"
54+
"bin-dir": "bin",
55+
"allow-plugins": {
56+
"php-http/discovery": true
57+
}
5458
}
5559
}

0 commit comments

Comments
 (0)