11name : Lint code & configuration
22
3- on :
4- pull_request :
5- push :
3+ # Runs tools to lint and validate the code and configuration. Only triggered by
4+ # creating new commits. If any of the jobs fail for new commits they're not
5+ # allowed to be merged into the default branch.
66
7- env :
8- fail-fast : true
9-
10- permissions :
11- contents : read
7+ on : [pull_request, push]
128
139jobs :
1410 linters :
1511 name : Linters
12+
1613 runs-on : ubuntu-latest
1714
1815 steps :
2219 - name : Install PHP with extensions
2320 uses : shivammathur/setup-php@v2
2421 with :
25- coverage : none
26- extensions : intl
2722 php-version : 8.3
2823 tools : composer:v2
2924
@@ -38,56 +33,48 @@ jobs:
3833 key : ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
3934 restore-keys : ${{ runner.os }}-composer-
4035
41- - name : Install dependencies
42- id : install
36+ - name : Install Composer dependencies
37+ id : composer- install
4338 run : composer install --ansi --no-interaction --no-progress
4439
45- - name : Lint YAML files
46- if : always() && steps.install.outcome == 'success'
47- run : bin/console lint:yaml .github config translations --parse-tags
48-
49- - name : Lint Twig templates
50- if : always() && steps.install.outcome == 'success'
51- run : bin/console lint:twig templates --env=prod
52-
53- # - name: Lint XLIFF translation files
54- # if: always() && steps.install.outcome == 'success'
55- # run: bin/console lint:xliff translations
40+ - name : Lint Composer configuration
41+ if : always() && steps.composer-install.outcome == 'success'
42+ run : composer validate --ansi
43+ # todo enable strict mode, currently license is invalid
44+ # run: composer validate --strict --ansi
5645
57- # - name: Lint translation contents
58- # if: always() && steps.install.outcome == 'success'
59- # run: bin/console lint:translations
46+ - name : Lint Symfony service container
47+ if : always() && steps.composer- install.outcome == 'success'
48+ run : bin/console lint:container --ansi
6049
61- - name : Lint Parameters and Services
62- if : always() && steps.install.outcome == 'success'
63- run : bin/console lint:container --no-debug
50+ - name : Lint translation files
51+ if : always() && steps.composer- install.outcome == 'success'
52+ run : bin/console lint:translations --ansi
6453
65- - name : Lint Composer config
66- if : always() && steps.install.outcome == 'success'
67- run : composer validate
68- # todo enable strict mode, currently license is invalid
69- # run: composer validate --strict
54+ - name : Lint Twig templates
55+ if : always() && steps.composer-install.outcome == 'success'
56+ run : bin/console lint:twig templates --ansi
7057
71- - name : Check if any dependencies are compromised
72- if : always() && steps.install.outcome == 'success'
73- run : composer audit
58+ - name : Lint YAML files
59+ if : always() && steps.composer- install.outcome == 'success'
60+ run : bin/console lint:yaml .github config translations --parse-tags --ansi
7461
75- - name : Check if any Symfony recipes are outdated
76- if : always() && steps.install.outcome == 'success'
77- run : composer recipes --outdated --no-interaction
62+ # - name: Lint XLIFF translation files
63+ # if: always() && steps.composer- install.outcome == 'success'
64+ # run: bin/console lint:xliff translations --ansi
7865
7966 php-cs-fixer :
8067 name : PHP-CS-Fixer
68+
8169 runs-on : ubuntu-latest
70+
8271 steps :
8372 - name : Checkout code
8473 uses : actions/checkout@v4
8574
8675 - name : Install PHP with extensions
8776 uses : shivammathur/setup-php@v2
8877 with :
89- coverage : none
90- extensions : intl
9178 php-version : 8.3
9279 tools : composer:v2
9380
@@ -102,15 +89,15 @@ jobs:
10289 key : ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
10390 restore-keys : ${{ runner.os }}-composer-
10491
105- - name : Install dependencies
106- id : install
92+ - name : Install Composer dependencies
10793 run : composer install --ansi --no-interaction --no-progress
10894
109- - name : PHP-CS-Fixer
110- run : ./ vendor/bin/php-cs-fixer fix --diff --dry-run
95+ - name : Run PHP-CS-Fixer
96+ run : vendor/bin/php-cs-fixer fix --diff --dry-run --ansi --show-progress none
11197
11298 phpstan :
11399 name : PHPStan
100+
114101 runs-on : ubuntu-latest
115102
116103 steps :
@@ -120,8 +107,6 @@ jobs:
120107 - name : Install PHP with extensions
121108 uses : shivammathur/setup-php@v2
122109 with :
123- coverage : none
124- extensions : intl
125110 php-version : 8.3
126111 tools : composer:v2
127112
@@ -136,10 +121,8 @@ jobs:
136121 key : ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
137122 restore-keys : ${{ runner.os }}-composer-
138123
139- - name : Install dependencies
140- id : install
124+ - name : Install Composer dependencies
141125 run : composer install --ansi --no-interaction --no-progress
142126
143127 - name : Run PHPStan
144- if : always() && steps.install.outcome == 'success'
145- run : ./vendor/bin/phpstan analyze
128+ run : vendor/bin/phpstan analyze --ansi --no-progress
0 commit comments