Skip to content

Commit 98a777b

Browse files
authored
Merge pull request #64 from php-etl/workflow/unified-quality
chore: unifier les workflows qualité
2 parents c4f49c3 + 32f2df7 commit 98a777b

19 files changed

Lines changed: 95 additions & 241 deletions

.github/workflows/infection.yaml

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

.github/workflows/phpstan-5.yaml

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

.github/workflows/phpstan-6.yaml

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

.github/workflows/phpstan-7.yaml

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

.github/workflows/phpstan-8.yaml

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

.github/workflows/phpunit.yaml

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

.github/workflows/quality.yaml

Lines changed: 77 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,78 @@
1-
name: Quality (PHPStan lvl 4)
2-
on: push
1+
name: Quality
2+
3+
on:
4+
push:
5+
branches: [main, master, next]
6+
pull_request:
7+
branches: [main, master, next]
8+
9+
env:
10+
PHP_VERSION: '8.4'
11+
312
jobs:
4-
cs-fixer:
5-
runs-on: ubuntu-latest
6-
steps:
7-
- uses: actions/checkout@v4
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@v4
22-
- uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: '8.2'
25-
coverage: none
26-
- uses: actions/cache@v4
27-
with:
28-
path: '**/vendor'
29-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
30-
restore-keys: |
31-
${{ runner.os }}-composer-
32-
- name: PHPStan
33-
run: |
34-
wget -qO phpstan.phar https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar
35-
chmod +x phpstan.phar
36-
./phpstan.phar analyse src --level=4
13+
quality:
14+
name: PHP-CS-Fixer, PHPStan, Rector, PHPUnit, Infection, PHPSpec
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ env.PHP_VERSION }}
22+
tools: composer:v2
23+
coverage: pcov
24+
25+
- uses: actions/cache@v4
26+
with:
27+
path: vendor
28+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock', 'composer.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-composer-
31+
32+
- name: Install dependencies
33+
run: composer install --no-interaction --prefer-dist
34+
35+
- name: PHP-CS-Fixer
36+
run: |
37+
if [ -f vendor/bin/php-cs-fixer ] && [ -d src ]; then
38+
vendor/bin/php-cs-fixer fix src --dry-run
39+
fi
40+
41+
- name: PHPStan
42+
run: |
43+
if [ ! -d src ]; then exit 0; fi
44+
if [ -f vendor/bin/phpstan ]; then
45+
vendor/bin/phpstan analyse src --level=8 --no-progress
46+
elif [ -f vendor/phpstan/phpstan/phpstan ]; then
47+
php vendor/phpstan/phpstan/phpstan analyse src --level=8 --no-progress
48+
fi
49+
50+
- name: Rector
51+
run: |
52+
if [ -f bin/rector ]; then
53+
bin/rector process --dry-run
54+
elif [ -f vendor/bin/rector ]; then
55+
vendor/bin/rector process --dry-run
56+
fi
57+
58+
- name: PHPUnit
59+
run: |
60+
if [ -f phpunit.xml ] || [ -f phpunit.xml.dist ]; then
61+
if [ -f infection.json ] || [ -f infection.json.dist ]; then
62+
vendor/bin/phpunit --coverage-html var/coverage --coverage-text
63+
else
64+
vendor/bin/phpunit
65+
fi
66+
fi
67+
68+
- name: Infection
69+
run: |
70+
if [ -f infection.json ] || [ -f infection.json.dist ]; then
71+
vendor/bin/infection run --no-progress --min-msi=0 --min-covered-msi=0
72+
fi
73+
74+
- name: PHPSpec
75+
run: |
76+
if [ -f bin/phpspec ] && [ -d spec ]; then
77+
bin/phpspec run spec
78+
fi

.github/workflows/rector.yaml

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

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"minimum-stability": "dev",
1313
"prefer-stable": true,
1414
"require": {
15-
"php": "^8.2",
15+
"php": "^8.4",
1616
"ext-json": "*",
17-
"nikic/php-parser": "^4.13.2",
17+
"nikic/php-parser": "^5.6",
1818
"symfony/config": "^6.0",
1919
"symfony/expression-language": "^6.0",
2020
"php-etl/configurator-contracts": "0.8.*",
@@ -31,10 +31,10 @@
3131
"guzzlehttp/psr7": "^2.0",
3232
"php-http/message": "^1.11",
3333
"php-http/curl-client": "^2.0",
34-
"phpstan/phpstan": "^1.10",
34+
"phpstan/phpstan": "^2.1",
3535
"friendsofphp/php-cs-fixer": "^3.0",
36-
"infection/infection": "^0.26.18",
37-
"rector/rector": "^0.15"
36+
"infection/infection": "^0.28",
37+
"rector/rector": "^2.3"
3838
},
3939
"autoload": {
4040
"psr-4": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php declare(strict_types=1);
22

3-
return new \Laminas\Diactoros\Response(body: new \Laminas\Diactoros\Stream(__DIR__.'/product.json'), status: 200);
3+
return new \GuzzleHttp\Psr7\Response(200, [], \GuzzleHttp\Psr7\Utils::streamFor(fopen(__DIR__.'/product.json', 'r')));

0 commit comments

Comments
 (0)