Skip to content

Commit 7339e90

Browse files
authored
Merge pull request #1 from php-etl/feature/github-actions
Updated github actions + added rector
2 parents 9233b01 + 4c8c720 commit 7339e90

13 files changed

+284
-132
lines changed

.github/workflows/infection.yaml

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

.github/workflows/phpstan-5.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ 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
18-
17+
php_version: 8.2
1918
- name: PHPStan
20-
uses: php-actions/phpstan@v2
19+
uses: php-actions/phpstan@v3
2120
with:
2221
path: src/
2322
args: --level=5

.github/workflows/phpstan-7.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ 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
18-
17+
php_version: 8.2
1918
- name: PHPStan
20-
uses: php-actions/phpstan@v2
19+
uses: php-actions/phpstan@v3
2120
with:
2221
path: src/
2322
args: --level=5

.github/workflows/phpstan-8.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@ 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
18-
17+
php_version: 8.2
1918
- name: PHPStan
20-
uses: php-actions/phpstan@v2
19+
uses: php-actions/phpstan@v3
2120
with:
2221
path: src/
2322
args: --level=5

.github/workflows/quality.yaml

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,9 @@ jobs:
44
cs-fixer:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v3
88
- name: Cs-Fixer
99
run: |
10-
wget -q https://cs.symfony.com/download/php-cs-fixer-v2.phar -O php-cs-fixer
10+
wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
1111
chmod a+x php-cs-fixer
1212
PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run
13-
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-
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-
42-
phpstan:
43-
runs-on: ubuntu-latest
44-
steps:
45-
- uses: actions/checkout@v2
46-
- uses: actions/cache@v2
47-
with:
48-
path: '**/vendor'
49-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
50-
restore-keys: |
51-
${{ runner.os }}-composer-
52-
- uses: php-actions/composer@v5
53-
with:
54-
args: --prefer-dist
55-
php_version: 8.0
56-
57-
- name: PHPStan
58-
uses: php-actions/phpstan@v2
59-
with:
60-
path: src/
61-
args: --level=4

.github/workflows/rector.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# github action that checks code with Rector
2+
name: Rector
3+
4+
on: pull_request
5+
6+
jobs:
7+
rector:
8+
runs-on: ubuntu-latest
9+
if: github.event.pull_request.head.repo.full_name == 'php-etl/action-console-runtime'
10+
steps:
11+
-
12+
if: github.event.pull_request.head.repo.full_name == github.repository
13+
uses: actions/checkout@v3
14+
with:
15+
# Must be used to trigger workflow after push
16+
token: ${{ secrets.ACCESS_TOKEN }}
17+
18+
-
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: 8.1
22+
coverage: none
23+
24+
- uses: "ramsey/composer-install@v2"
25+
26+
- run: bin/rector --ansi
27+
28+
-
29+
# commit only to core contributors who have repository access
30+
uses: stefanzweifel/git-auto-commit-action@v4
31+
with:
32+
commit_message: '[rector] Rector fixes'
33+
commit_author: 'GitHub Action <[email protected]>'
34+
commit_user_email: '[email protected]'

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
/vendor/
1+
/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,

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"minimum-stability": "dev",
1717
"prefer-stable": true,
1818
"require": {
19-
"php": "^8.0",
19+
"php": "^8.2",
2020
"symfony/console": "^5.2",
21-
"php-etl/pipeline-contracts": "^0.3.0",
22-
"php-etl/console-state": "^0.1.0"
21+
"php-etl/console-state": "^0.1.0",
22+
"php-etl/action-contracts": "^0.1.0"
2323
},
2424
"autoload": {
2525
"psr-4": {
@@ -33,5 +33,8 @@
3333
"branch-alias": {
3434
"dev-main": "0.1.x-dev"
3535
}
36+
},
37+
"require-dev": {
38+
"rector/rector": "^0.15.0"
3639
}
3740
}

0 commit comments

Comments
 (0)