Skip to content

Commit 0acaa0b

Browse files
authored
Merge pull request #6 from php-etl/feature/github-actions
Added GitHub actions + updated dependencies
2 parents 63f7856 + 13c73b8 commit 0acaa0b

16 files changed

+454
-4389
lines changed

.github/workflows/infection.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/phpstan-5.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ jobs:
44
phpstan:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/cache@v2
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
99
with:
1010
path: '**/vendor'
1111
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1212
restore-keys: |
1313
${{ runner.os }}-composer-
14-
- uses: php-actions/composer@v5
14+
- uses: php-actions/composer@v6
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: '8.2'
1818
- name: PHPStan
19-
uses: php-actions/phpstan@v2
19+
uses: php-actions/phpstan@v3
2020
with:
2121
path: src/
2222
level: 5
23-
php_version: 8.0
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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ jobs:
44
phpstan:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/cache@v2
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
99
with:
1010
path: '**/vendor'
1111
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1212
restore-keys: |
1313
${{ runner.os }}-composer-
14-
- uses: php-actions/composer@v5
14+
- uses: php-actions/composer@v6
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: '8.2'
18+
1819
- name: PHPStan
19-
uses: php-actions/phpstan@v2
20+
uses: php-actions/phpstan@v3
2021
with:
2122
path: src/
2223
level: 7
23-
php_version: 8.0

.github/workflows/phpstan-8.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ jobs:
44
phpstan:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/cache@v2
7+
- uses: actions/checkout@v3
8+
- uses: actions/cache@v3
99
with:
1010
path: '**/vendor'
1111
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
1212
restore-keys: |
1313
${{ runner.os }}-composer-
14-
- uses: php-actions/composer@v5
14+
- uses: php-actions/composer@v6
1515
with:
1616
args: --prefer-dist
17-
php_version: 8.0
17+
php_version: '8.2'
18+
1819
- name: PHPStan
19-
uses: php-actions/phpstan@v2
20+
uses: php-actions/phpstan@v3
2021
with:
2122
path: src/
2223
level: 8
23-
php_version: 8.0

.github/workflows/quality.yaml

Lines changed: 32 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,36 @@
1-
name: Quality (PHPStan level 4)
1+
name: Quality (PHPStan lvl 4)
22
on: push
33
jobs:
4-
cs-fixer:
5-
runs-on: ubuntu-latest
6-
steps:
7-
- uses: actions/checkout@v2
8-
- name: Cs-Fixer
9-
run: |
10-
wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
11-
chmod a+x php-cs-fixer
12-
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
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
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.0'
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.0
33-
- name: Run tests & generate Coverage
34-
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage --whitelist=src
35-
- name: Store coverage files
36-
uses: actions/upload-artifact@v2
37-
with:
38-
path: var/coverage
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'
3931

40-
phpstan:
41-
runs-on: ubuntu-latest
42-
steps:
43-
- uses: actions/checkout@v2
44-
- uses: actions/cache@v2
45-
with:
46-
path: '**/vendor'
47-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
48-
restore-keys: |
49-
${{ runner.os }}-composer-
50-
- uses: php-actions/composer@v5
51-
with:
52-
args: --prefer-dist
53-
php_version: 8.0
54-
- name: PHPStan
55-
uses: php-actions/phpstan@v2
56-
with:
57-
path: src/
58-
level: 4
59-
php_version: 8.0
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/rabbitmq-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]'

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

composer.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,27 @@
2626
}
2727
},
2828
"config": {
29-
"bin-dir": "bin"
29+
"bin-dir": "bin",
30+
"allow-plugins": {
31+
"infection/extension-installer": true
32+
}
3033
},
3134
"minimum-stability": "dev",
3235
"prefer-stable": true,
3336
"require": {
34-
"php": "^8.0",
35-
"php-etl/pipeline-contracts": "^0.3.0",
36-
"php-etl/bucket": "^0.2.0",
37+
"php": "^8.2",
38+
"php-etl/pipeline-contracts": "0.4.*",
39+
"php-etl/bucket": "*",
3740
"bunny/bunny": "*",
3841
"ramsey/uuid": "^4.2"
3942
},
4043
"require-dev": {
41-
"phpunit/phpunit": "^9.0",
42-
"phpunit/php-invoker": "*",
43-
"johnkary/phpunit-speedtrap": "*",
44-
"mybuilder/phpunit-accelerator": "*",
45-
"infection/infection": "^0.20",
46-
"adlawson/vfs": "*"
44+
"rector/rector": "^0.15.24",
45+
"mikey179/vfsstream": "^1.6"
4746
},
4847
"extra": {
4948
"branch-alias": {
50-
"dev-main": "0.1.x-dev"
49+
"dev-main": "0.2.x-dev"
5150
}
5251
}
5352
}

0 commit comments

Comments
 (0)