Skip to content

Commit 32f2df7

Browse files
committed
chore: unifier les workflows qualité (PHP-CS-Fixer, PHPStan, Rector, PHPUnit, Infection, PHPSpec)
- Workflow racine: découverte des paquets, matrix PHP-CS-Fixer et PHPStan (PHP 8.4, level 8) - Workflow unifié par paquet: un seul fichier quality.yaml remplaçant les workflows multiples - Suppression des workflows phpstan-5/6/7/8, rector, phpunit, infection, phpspec séparés - Conservation de package-split.yaml (runtime-distribution) et gh-pages.yml (documentation) Made-with: Cursor
1 parent 98cfb25 commit 32f2df7

8 files changed

Lines changed: 77 additions & 223 deletions

File tree

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

0 commit comments

Comments
 (0)