Skip to content

Commit 7c04303

Browse files
authored
Merge pull request #3 from php-etl/feature/qualityflow-improvments
update composer to php 8.2, Add github actions, validate cs-fixer, va…
2 parents 3fb9a36 + 0fd4ede commit 7c04303

33 files changed

+4918
-159
lines changed

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

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

.github/workflows/quality.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Quality (PHPStan lvl 3)
2+
on: push
3+
jobs:
4+
cs-fixer:
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+
coverage: none
12+
- name: Cs-Fixer
13+
run: |
14+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
15+
chmod a+x php-cs-fixer
16+
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
17+
18+
phpstan:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/cache@v3
23+
with:
24+
path: '**/vendor'
25+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-composer-
28+
- uses: php-actions/composer@v6
29+
with:
30+
args: --prefer-dist
31+
php_version: '8.2'
32+
- name: PHPStan
33+
uses: php-actions/phpstan@v3
34+
with:
35+
path: src/
36+
level: 3
37+
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: pull_request
5+
6+
jobs:
7+
rector:
8+
# Don't run on forks.
9+
if: github.repository == 'php-etl/dockerfile'
10+
runs-on: ubuntu-latest
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+
-
24+
# commit only to core contributors who have repository access
25+
if: github.event.pull_request.head.repo.full_name == github.repository
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/vendor/
2+
/.php-cs-fixer.cache
3+
/bin/

.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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Dockerfile
2+
===
3+
4+
[![Quality (PHPStan lvl 3)](https://github.com/php-etl/dockerfile/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/dockerfile/actions/workflows/quality.yaml)
5+
[![PHPUnit](https://github.com/php-etl/dockerfile/actions/workflows/phpunit.yaml/badge.svg)](https://github.com/php-etl/dockerfile/actions/workflows/phpunit.yaml)
6+
[![Infection](https://github.com/php-etl/dockerfile/actions/workflows/infection.yaml/badge.svg)](https://github.com/php-etl/dockerfile/actions/workflows/infection.yaml)
7+
[![PHPStan level 5](https://github.com/php-etl/dockerfile/actions/workflows/phpstan-5.yaml/badge.svg)](https://github.com/php-etl/dockerfile/actions/workflows/phpstan-5.yaml)
8+
[![PHPStan level 6](https://github.com/php-etl/dockerfile/actions/workflows/phpstan-6.yaml/badge.svg)](https://github.com/php-etl/dockerfile/actions/workflows/phpstan-6.yaml)
9+
[![PHPStan level 7](https://github.com/php-etl/dockerfile/actions/workflows/phpstan-7.yaml/badge.svg)](https://github.com/php-etl/dockerfile/actions/workflows/phpstan-7.yaml)
10+
[![PHPStan level 8](https://github.com/php-etl/dockerfile/actions/workflows/phpstan-8.yaml/badge.svg)](https://github.com/php-etl/dockerfile/actions/workflows/phpstan-8.yaml)
11+
![PHP](https://img.shields.io/packagist/php-v/php-etl/dockerfile)

composer.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@
1111
"minimum-stability": "dev",
1212
"prefer-stable": true,
1313
"require": {
14-
"php": "^8.0",
15-
"php-etl/packaging-contracts": "^0.1.0"
14+
"php": "^8.2",
15+
"php-etl/packaging-contracts": "^0.3.0"
16+
},
17+
"require-dev": {
18+
"phpunit/phpunit": "^10.0",
19+
"phpstan/phpstan": "^1.10",
20+
"friendsofphp/php-cs-fixer": "^3.0",
21+
"infection/infection": "^0.26.18",
22+
"rector/rector": "^0.15"
1623
},
1724
"autoload": {
1825
"psr-4": {
@@ -26,10 +33,13 @@
2633
},
2734
"extra": {
2835
"branch-alias": {
29-
"dev-main": "0.1.x-dev"
36+
"dev-main": "0.2.x-dev"
3037
}
3138
},
3239
"config": {
33-
"bin-dir": "bin"
40+
"bin-dir": "bin",
41+
"allow-plugins": {
42+
"infection/extension-installer": true
43+
}
3444
}
3545
}

0 commit comments

Comments
 (0)