Skip to content

Commit 58be830

Browse files
GitHub Actions - check-files workflow - split into steps as a workaround for step template size limit (#3276)
* Refs #3275: GitHub Actions - `check-files` workflow - split into steps as a workaround for step template size limit * Update .all-contributorsrc --------- Co-authored-by: Fabrizio Balliano <fabrizio.balliano@gmail.com>
1 parent 090e217 commit 58be830

File tree

2 files changed

+58
-13
lines changed

2 files changed

+58
-13
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,15 @@
13821382
"contributions": [
13831383
"code"
13841384
]
1385+
},
1386+
{
1387+
"login": "gorbunovav",
1388+
"name": "Andrey Gorbunov",
1389+
"avatar_url": "https://avatars.githubusercontent.com/u/2665015?v=4",
1390+
"profile": "https://github.com/gorbunovav",
1391+
"contributions": [
1392+
"code"
1393+
]
13851394
}
13861395
],
13871396
"contributorsPerLine": 7

.github/workflows/check-files.yml

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ jobs:
4141
name: Changed
4242
runs-on: [ubuntu-latest]
4343
outputs:
44-
composer: ${{ steps.all.outputs.composer }}
45-
php: ${{ steps.all.outputs.php }}
46-
xml: ${{ steps.all.outputs.xml }}
47-
workflow: ${{ steps.all.outputs.workflow }}
48-
phpcs: ${{ steps.all.outputs.phpcs }}
49-
php-cs-fixer: ${{ steps.all.outputs.php-cs-fixer }}
50-
phpstan: ${{ steps.all.outputs.phpstan }}
51-
phpunit-test: ${{ steps.all.outputs.phpunit-test }}
52-
phpunit: ${{ steps.all.outputs.phpunit }}
53-
sonar: ${{ steps.all.outputs.sonar }}
44+
composer: ${{ steps.changes-composer.outputs.composer }}
45+
php: ${{ steps.changes-php.outputs.php }}
46+
xml: ${{ steps.changes-xml.outputs.xml }}
47+
workflow: ${{ steps.changes-workflow.outputs.workflow }}
48+
phpcs: ${{ steps.changes-phpcs.outputs.phpcs }}
49+
php-cs-fixer: ${{ steps.changes-php-cs-fixer.outputs.php-cs-fixer }}
50+
phpstan: ${{ steps.changes-phpstan.outputs.phpstan }}
51+
phpunit-test: ${{ steps.changes-phpunit-test.outputs.phpunit-test }}
52+
phpunit: ${{ steps.changes-phpunit.outputs.phpunit }}
53+
sonar: ${{ steps.changes-sonar.outputs.sonar }}
5454

5555
steps:
5656
- name: Checkout code
@@ -86,8 +86,8 @@ jobs:
8686
dev/phpunit*
8787
dev/sonar*
8888
89-
- name: Run step if any file(s) changed
90-
id: all
89+
- name: Check if composer files changed
90+
id: changes-composer
9191
if: steps.changed-files-specific.outputs.any_modified == 'true'
9292
run: |
9393
echo "One or more files have changed."
@@ -96,38 +96,74 @@ jobs:
9696
echo "$count Composer file(s) changed"
9797
echo "composer=$count" >> $GITHUB_OUTPUT
9898
99+
- name: Check if PHP files changed
100+
id: changes-php
101+
if: steps.changed-files-specific.outputs.any_modified == 'true'
102+
run: |
99103
count="$(grep -oE "*.php" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
100104
echo "$count PHP file(s) changed"
101105
echo "php=$count" >> $GITHUB_OUTPUT
102106
107+
- name: Check if XML files changed
108+
id: changes-xml
109+
if: steps.changed-files-specific.outputs.any_modified == 'true'
110+
run: |
103111
count="$(grep -oE "*.xml" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
104112
echo "$count XML file(s) changed"
105113
echo "xml=$count" >> $GITHUB_OUTPUT
106114
115+
- name: Check if Workflow files changed
116+
id: changes-workflow
117+
if: steps.changed-files-specific.outputs.any_modified == 'true'
118+
run: |
107119
count="$(grep -oE ".github/workflows/**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
108120
echo "$count Workflow file(s) changed"
109121
echo "workflow=$count" >> $GITHUB_OUTPUT
110122
123+
- name: Check if PHPCS test files changed
124+
id: changes-phpcs
125+
if: steps.changed-files-specific.outputs.any_modified == 'true'
126+
run: |
111127
count="$(grep -oE "**phpcs**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
112128
echo "$count PHPCS file(s) changed"
113129
echo "phpcs=$count" >> $GITHUB_OUTPUT
114130
131+
- name: Check if PHP-CS-Fixer files changed
132+
id: changes-php-cs-fixer
133+
if: steps.changed-files-specific.outputs.any_modified == 'true'
134+
run: |
115135
count="$(grep -oE "**php-cs-fixer**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
116136
echo "$count PHP-CS-Fixer file(s) changed"
117137
echo "php-cs-fixer=$count" >> $GITHUB_OUTPUT
118138
139+
- name: Check if PHPStan files changed
140+
id: changes-phpstan
141+
if: steps.changed-files-specific.outputs.any_modified == 'true'
142+
run: |
119143
count="$(grep -oE "**phpstan**" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
120144
echo "$count PHPStan file(s) changed"
121145
echo "phpstan=$count" >> $GITHUB_OUTPUT
122146
147+
- name: Check if PHPUnit test files changed
148+
id: changes-phpunit-test
149+
if: steps.changed-files-specific.outputs.any_modified == 'true'
150+
run: |
123151
count="$(grep -oE "dev/tests/" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
124152
echo "$count UnitTest test file(s) changed"
125153
echo "phpunit-test=$count" >> $GITHUB_OUTPUT
126154
155+
- name: Check if PHPUnit files changed
156+
id: changes-phpunit
157+
if: steps.changed-files-specific.outputs.any_modified == 'true'
158+
run: |
127159
count="$(grep -oE "dev/phpunit*" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
128-
echo "$count UnitTest file(s) changed"
160+
echo "$count PHPUnit file(s) changed"
129161
echo "phpunit=$count" >> $GITHUB_OUTPUT
130162
163+
- name: Check if Sonar files changed
164+
id: changes-sonar
165+
if: steps.changed-files-specific.outputs.any_modified == 'true'
166+
run: |
131167
count="$(grep -oE "dev/sonar*" <<< "${{ steps.changed-files-specific.outputs.all_modified_files }}" | wc -l)"
132168
echo "$count Sonar file(s) changed"
133169
echo "sonar=$count" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)