Skip to content

Commit 67cccd0

Browse files
committed
Split github actions, Add a phpstan lvl 6, validate cs-fixer, validate phpstan lvl3, add rector action, upgrade php 8.2 with rector, update infection
1 parent cbdad3d commit 67cccd0

18 files changed

+2298
-729
lines changed

.github/workflows/actions.yml

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

.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-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/quality.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Quality (PHPStan lvl 5)
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 --dry-run --config=.php-cs-fixer.dist.php
16+
17+
phpunit:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: '8.2'
24+
tools: composer:v2
25+
coverage: pcov
26+
- uses: actions/cache@v3
27+
with:
28+
path: '**/vendor'
29+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
30+
restore-keys: |
31+
${{ runner.os }}-composer-
32+
- uses: php-actions/composer@v6
33+
with:
34+
args: --prefer-dist
35+
php_version: '8.2'
36+
37+
- name: Run tests & generate Coverage
38+
run: bin/phpunit --configuration=phpunit.xml tests --coverage-html var/coverage
39+
40+
- name: Store coverage files
41+
uses: actions/upload-artifact@v3
42+
with:
43+
path: var/coverage
44+
45+
phpstan:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v3
49+
- uses: actions/cache@v3
50+
with:
51+
path: '**/vendor'
52+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
53+
restore-keys: |
54+
${{ runner.os }}-composer-
55+
- uses: php-actions/composer@v6
56+
with:
57+
args: --prefer-dist
58+
php_version: '8.2'
59+
60+
- name: PHPStan
61+
uses: php-actions/phpstan@v3
62+
with:
63+
path: src/
64+
args: --level=5
65+

.github/workflows/rector.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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/string-expression-language'
11+
steps:
12+
-
13+
if: github.event.pull_request.head.repo.full_name == github.repository
14+
uses: actions/checkout@v3
15+
with:
16+
# Must be used to trigger workflow after push
17+
token: ${{ secrets.ACCESS_TOKEN }}
18+
19+
-
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '8.2'
23+
coverage: none
24+
25+
- uses: "ramsey/composer-install@v2"
26+
27+
- run: bin/rector --ansi
28+
29+
-
30+
# commit only to core contributors who have repository access
31+
uses: stefanzweifel/git-auto-commit-action@v4
32+
with:
33+
commit_message: '[rector] Rector fixes'
34+
commit_author: 'GitHub Action <actions@github.com>'
35+
commit_user_email: 'action@github.com'

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
/vendor/
2+
bin/
3+
.php-cs-fixer.cache
4+
.phpunit.result.cache

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
"minimum-stability": "dev",
1313
"prefer-stable": true,
1414
"require": {
15-
"php": "^8.0",
15+
"php": "^8.2",
1616
"symfony/expression-language": "^5.2"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "^9.0"
19+
"phpunit/phpunit": "^9.5 || ^10.0",
20+
"rector/rector": "^0.15",
21+
"phpstan/phpstan": "^1.10",
22+
"friendsofphp/php-cs-fixer": "^3.0"
2023
},
2124
"autoload": {
2225
"psr-4": {
@@ -30,7 +33,8 @@
3033
},
3134
"extra": {
3235
"branch-alias": {
33-
"dev-main": "0.1.x-dev"
36+
"dev-main": "0.3.x-dev",
37+
"dev-feature/qualityflow-improvments": "0.3.x-dev"
3438
}
3539
},
3640
"config": {

0 commit comments

Comments
 (0)