Skip to content

Commit 1388f34

Browse files
authored
Merge pull request #3 from php-etl/feature/upgraded-php-version
Added GitHub actions + updated dependencies
2 parents 08ab3d1 + 950c001 commit 1388f34

24 files changed

+1054
-1006
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+
- 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+
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/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: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Quality (PHPStan lvl 4)
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+
- name: Cs-Fixer
12+
run: |
13+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
14+
chmod a+x php-cs-fixer
15+
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
16+
17+
phpstan:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/cache@v3
22+
with:
23+
path: '**/vendor'
24+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
25+
restore-keys: |
26+
${{ runner.os }}-composer-
27+
- uses: php-actions/composer@v6
28+
with:
29+
args: --prefer-dist
30+
php_version: '8.2'
31+
32+
- name: PHPStan
33+
uses: php-actions/phpstan@v3
34+
with:
35+
path: src/
36+
level: 4

.github/workflows/rector.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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/magento2-flow'
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+
- # commit only to core contributors who have repository access
24+
uses: stefanzweifel/git-auto-commit-action@v4
25+
with:
26+
commit_message: '[rector] Rector fixes'
27+
commit_author: 'GitHub Action <[email protected]>'
28+
commit_user_email: '[email protected]'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/vendor/
2+
/bin

.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+
;

0 commit comments

Comments
 (0)