Skip to content

Commit 0f63e05

Browse files
authored
Merge pull request #12 from php-etl/feature/qualityflow-improvments
Split github actions, Add a phpstan lvl 6, validate cs-fixer, validat…
2 parents f0e5833 + d1f854b commit 0f63e05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4571
-2925
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+
phpstan5:
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+
phpstan6:
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+
phpstan7:
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+
phpstan8:
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/phpunit.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
extension: pdo
13+
coverage: pcov
14+
- uses: actions/cache@v3
15+
with:
16+
path: '**/vendor'
17+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
18+
restore-keys: |
19+
${{ runner.os }}-composer-
20+
- uses: php-actions/composer@v6
21+
with:
22+
args: --prefer-dist
23+
php_version: '8.2'
24+
25+
- name: Run tests & generate Coverage
26+
run: bin/phpunit --coverage-html var/coverage
27+
28+
- name: Store coverage files
29+
uses: actions/upload-artifact@v3
30+
with:
31+
path: var/coverage

.github/workflows/quality.yaml

Lines changed: 9 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -4,153 +4,34 @@ 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
1114
chmod a+x php-cs-fixer
1215
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix --dry-run --config=.php-cs-fixer.dist.php
1316
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.2'
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.2
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-
4217
phpstan:
4318
runs-on: ubuntu-latest
4419
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions/cache@v2
20+
- uses: actions/checkout@v3
21+
- uses: actions/cache@v3
4722
with:
4823
path: '**/vendor'
4924
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
5025
restore-keys: |
5126
${{ runner.os }}-composer-
52-
- uses: php-actions/composer@v5
27+
- uses: php-actions/composer@v6
5328
with:
5429
args: --prefer-dist
55-
php_version: 8.2
30+
php_version: '8.2'
5631

5732
- name: PHPStan
58-
uses: php-actions/phpstan@v2
33+
uses: php-actions/phpstan@v3
5934
with:
6035
path: src/
6136
args: --level=4
6237

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: 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/sql-plugin'
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: 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,

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
# SQL Plugin
1+
SQL Plugin
2+
===
3+
4+
[![Mutations](https://github.com/php-etl/sql-plugin/actions/workflows/infection.yaml/badge.svg)](https://github.com/php-etl/sql-plugin/actions/workflows/infection.yaml)
5+
[![PHPUnit](https://github.com/php-etl/sql-plugin/actions/workflows/phpunit.yaml/badge.svg)](https://github.com/php-etl/sql-plugin/actions/workflows/phpunit.yaml)
6+
[![Quality](https://github.com/php-etl/sql-plugin/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/sql-plugin/actions/workflows/quality.yaml)
7+
[![PHPStan level 5](https://github.com/php-etl/sql-plugin/actions/workflows/phpstan-5.yaml/badge.svg)](https://github.com/php-etl/sql-plugin/actions/workflows/phpstan-5.yaml)
8+
[![PHPStan level 6](https://github.com/php-etl/sql-plugin/actions/workflows/phpstan-6.yaml/badge.svg)](https://github.com/php-etl/sql-plugin/actions/workflows/phpstan-6.yaml)
9+
[![PHPStan level 7](https://github.com/php-etl/sql-plugin/actions/workflows/phpstan-7.yaml/badge.svg)](https://github.com/php-etl/sql-plugin/actions/workflows/phpstan-7.yaml)
10+
[![PHPStan level 8](https://github.com/php-etl/sql-plugin/actions/workflows/phpstan-8.yaml/badge.svg)](https://github.com/php-etl/sql-plugin/actions/workflows/phpstan-8.yaml)
11+
![PHP](https://img.shields.io/packagist/php-v/php-etl/sql-plugin)
212

313
## What is it ?
414

0 commit comments

Comments
 (0)