Skip to content

Commit 0368634

Browse files
authored
Merge branch 'main' into hotfix/jq-failures-on-composer-autoloads
2 parents 465c341 + 3ba51c0 commit 0368634

32 files changed

+4981
-134
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: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
])
38+
->setFinder($finder)
39+
->setCacheFile('.php-cs-fixer.cache') // forward compatibility with 3.x line
40+
;

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.*"
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)