Skip to content

Commit 92c657a

Browse files
authored
Merge pull request #25 from php-etl/workflow/unified-quality
chore: unifier les workflows qualité
2 parents 9e3bfc5 + f625970 commit 92c657a

10 files changed

Lines changed: 3309 additions & 2503 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@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
16-
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'
31-
32-
- name: PHPStan
33-
uses: php-actions/phpstan@v3
34-
with:
35-
path: src/
36-
level: 8
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 & 28 deletions
This file was deleted.

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"phpunit/phpunit": "^10.0",
2626
"php-etl/phpunit-extension": "*",
2727
"friendsofphp/php-cs-fixer": "^3.0",
28-
"phpstan/phpstan": "^2.2",
29-
"infection/infection": "^0.26.18",
30-
"rector/rector": "^2.0",
28+
"phpstan/phpstan": "^2.1",
29+
"infection/infection": "^0.28",
30+
"rector/rector": "^2.3",
3131
"php-etl/csv-flow": "*",
3232
"mikey179/vfsstream": "^1.6"
3333
},

0 commit comments

Comments
 (0)