Skip to content

Commit e4ce782

Browse files
fix(workflows): Enhance composer command inputs with flags and options. (#67)
1 parent 95ddb4b commit e4ce782

File tree

9 files changed

+133
-40
lines changed

9 files changed

+133
-40
lines changed

.github/workflows/codeception.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ on:
1010
required: false
1111
type: string
1212
composer-command:
13-
description: Composer command to run.
14-
default: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
13+
description: Composer command (install or update) to run.
14+
default: update
15+
required: false
16+
type: string
17+
composer-flags:
18+
description: Additional composer flags
19+
default: >-
20+
--prefer-dist
21+
--no-interaction
22+
--no-progress
23+
--optimize-autoloader
24+
--ansi
1525
required: false
1626
type: string
1727
composer-version:
@@ -106,6 +116,7 @@ jobs:
106116
with:
107117
auth-token: ${{ secrets.AUTH_TOKEN }}
108118
composer-command: ${{ inputs.composer-command }}
119+
composer-flags: ${{ inputs.composer-flags }}
109120
composer-version: ${{ inputs.composer-version }}
110121
coverage-driver: ${{ inputs.coverage-driver }}
111122
extensions: ${{ inputs.extensions }}

.github/workflows/composer-require-checker.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ on:
1010
required: false
1111
type: string
1212
composer-command:
13-
description: Composer command to run.
14-
default: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
13+
description: Composer command (install or update) to run.
14+
default: update
15+
required: false
16+
type: string
17+
composer-flags:
18+
description: Additional composer flags
19+
default: >-
20+
--prefer-dist
21+
--no-interaction
22+
--no-progress
23+
--optimize-autoloader
24+
--ansi
1525
required: false
1626
type: string
1727
composer-version:
@@ -89,6 +99,7 @@ jobs:
8999
with:
90100
auth-token: ${{ secrets.AUTH_TOKEN }}
91101
composer-command: ${{ inputs.composer-command }}
102+
composer-flags: ${{ inputs.composer-flags }}
92103
composer-version: ${{ inputs.composer-version }}
93104
coverage-driver: none
94105
extensions: ${{ inputs.extensions }}

.github/workflows/ecs.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ on:
1010
required: false
1111
type: string
1212
composer-command:
13-
description: Composer command to run.
14-
default: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
13+
description: Composer command (install or update) to run.
14+
default: update
15+
required: false
16+
type: string
17+
composer-flags:
18+
description: Additional composer flags
19+
default: >-
20+
--prefer-dist
21+
--no-interaction
22+
--no-progress
23+
--optimize-autoloader
24+
--ansi
1525
required: false
1626
type: string
1727
composer-version:
@@ -89,6 +99,7 @@ jobs:
8999
with:
90100
auth-token: ${{ secrets.AUTH_TOKEN }}
91101
composer-command: ${{ inputs.composer-command }}
102+
composer-flags: ${{ inputs.composer-flags }}
92103
composer-version: ${{ inputs.composer-version }}
93104
coverage-driver: none
94105
extensions: ${{ inputs.extensions }}

.github/workflows/infection.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ on:
2525
required: false
2626
type: string
2727
composer-command:
28-
description: Composer command to run.
29-
default: |-
30-
composer update \
31-
--prefer-dist \
32-
--no-interaction \
33-
--no-progress \
34-
--optimize-autoloader \
35-
--ansi
28+
description: Composer command (install or update) to run.
29+
default: update
30+
required: false
31+
type: string
32+
composer-flags:
33+
description: Additional composer flags
34+
default: >-
35+
--prefer-dist
36+
--no-interaction
37+
--no-progress
38+
--optimize-autoloader
39+
--ansi
3640
required: false
3741
type: string
3842
composer-version:
@@ -136,6 +140,7 @@ jobs:
136140
with:
137141
auth-token: ${{ secrets.AUTH_TOKEN }}
138142
composer-command: ${{ inputs.composer-command }}
143+
composer-flags: ${{ inputs.composer-flags }}
139144
composer-version: ${{ inputs.composer-version }}
140145
coverage-driver: ${{ inputs.coverage-driver }}
141146
extensions: ${{ inputs.extensions }}
@@ -159,19 +164,19 @@ jobs:
159164
- name: Run PHPStan (build cache).
160165
if: ${{ inputs.phpstan }}
161166
shell: bash
162-
run: |-
163-
vendor/bin/phpstan \
164-
--configuration="${{ inputs.phpstan-configuration }}" \
165-
analyse
167+
run: >-
168+
vendor/bin/phpstan
169+
--configuration="${{ inputs.phpstan-configuration }}"
170+
analyse
166171
167172
- name: Run infection.
168173
shell: bash
169-
run: |-
170-
vendor/bin/${{ inputs.command }} \
171-
${{ inputs.command-options }} \
172-
${{ inputs.command-coverage-options }} \
173-
${{ inputs.phpstan && '--static-analysis-tool=phpstan' || '' }} \
174-
${{ inputs.framework-options }}
174+
run: >-
175+
vendor/bin/${{ inputs.command }}
176+
${{ inputs.command-options }}
177+
${{ inputs.phpstan && '--static-analysis-tool=phpstan' || '' }}
178+
${{ inputs.command-coverage-options }}
179+
${{ inputs.framework-options }}
175180
env:
176181
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
177182

.github/workflows/phpstan.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ on:
1010
required: false
1111
type: string
1212
composer-command:
13-
description: Composer command to run.
14-
default: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
13+
description: Composer command (install or update) to run.
14+
default: update
15+
required: false
16+
type: string
17+
composer-flags:
18+
description: Additional composer flags
19+
default: >-
20+
--prefer-dist
21+
--no-interaction
22+
--no-progress
23+
--optimize-autoloader
24+
--ansi
1525
required: false
1626
type: string
1727
composer-version:
@@ -99,6 +109,7 @@ jobs:
99109
with:
100110
auth-token: ${{ secrets.AUTH_TOKEN }}
101111
composer-command: ${{ inputs.composer-command }}
112+
composer-flags: ${{ inputs.composer-flags }}
102113
composer-version: ${{ inputs.composer-version }}
103114
coverage-driver: none
104115
extensions: ${{ inputs.extensions }}
@@ -112,4 +123,7 @@ jobs:
112123
run: ${{ inputs.hook }}
113124

114125
- name: Static analysis.
115-
run: vendor/bin/phpstan --configuration=${{ inputs.configuration }} ${{ inputs.command-options }}
126+
run: >-
127+
vendor/bin/phpstan
128+
--configuration=${{ inputs.configuration }}
129+
${{ inputs.command-options }}

.github/workflows/phpunit-database.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@ on:
55
workflow_call:
66
inputs:
77
composer-command:
8-
description: Composer command to run.
9-
default: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
8+
description: Composer command (install or update) to run.
9+
default: update
10+
required: false
11+
type: string
12+
composer-flags:
13+
description: Additional composer flags
14+
default: >-
15+
--prefer-dist
16+
--no-interaction
17+
--no-progress
18+
--optimize-autoloader
19+
--ansi
1020
required: false
1121
type: string
1222
composer-version:
@@ -191,6 +201,7 @@ jobs:
191201
with:
192202
auth-token: ${{ secrets.AUTH_TOKEN }}
193203
composer-command: ${{ inputs.composer-command }}
204+
composer-flags: ${{ inputs.composer-flags }}
194205
composer-version: ${{ inputs.composer-version }}
195206
coverage-driver: ${{ inputs.coverage-driver }}
196207
extensions: ${{ inputs.extensions }}

.github/workflows/phpunit.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@ on:
55
workflow_call:
66
inputs:
77
composer-command:
8-
description: Composer command to run.
9-
default: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
8+
description: Composer command (install or update) to run.
9+
default: update
10+
required: false
11+
type: string
12+
composer-flags:
13+
description: Additional composer flags
14+
default: >-
15+
--prefer-dist
16+
--no-interaction
17+
--no-progress
18+
--optimize-autoloader
19+
--ansi
1020
required: false
1121
type: string
1222
composer-version:
@@ -137,6 +147,7 @@ jobs:
137147
with:
138148
auth-token: ${{ secrets.AUTH_TOKEN }}
139149
composer-command: ${{ inputs.composer-command }}
150+
composer-flags: ${{ inputs.composer-flags }}
140151
composer-version: ${{ inputs.composer-version }}
141152
coverage-driver: ${{ inputs.coverage-driver }}
142153
extensions: ${{ inputs.extensions }}

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## v2.0.4 Under development
44

5-
- Bug #66: Fix `linter.yml` workflow to add permissions for checks, contents, and statuses.
5+
- Bug #66: Fix `linter.yml` workflow to add permissions for checks, contents, and statuses (@terabytesoftw)
6+
- Bug #67: Enhance composer command inputs with flags and options (@terabytesoftw)
67

78
## v2.0.3 September 28, 2025
89

actions/php-setup/action.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ inputs:
99
required: false
1010
type: string
1111
composer-command:
12-
description: Composer command to run.
13-
default: |-
14-
composer update --prefer-dist \
15-
--no-interaction \
16-
--no-progress \
17-
--optimize-autoloader \
12+
description: Composer command (install or update) to run.
13+
default: update
14+
required: false
15+
type: string
16+
composer-flags:
17+
description: Additional composer flags
18+
default: >-
19+
--prefer-dist
20+
--no-interaction
21+
--no-progress
22+
--optimize-autoloader
1823
--ansi
1924
required: false
2025
type: string
@@ -33,6 +38,11 @@ inputs:
3338
default:
3439
required: false
3540
type: string
41+
ignore-platform-reqs:
42+
description: Whether to add --ignore-platform-reqs to composer command.
43+
default: false
44+
required: false
45+
type: boolean
3646
ini-values:
3747
description: Initial values for PHP configuration.
3848
default: date.timezone='UTC'
@@ -86,6 +96,14 @@ runs:
8696
env:
8797
AUTH_TOKEN: ${{ inputs.auth-token }}
8898

89-
- name: Install dependencies
99+
- name: Install dependencies with composer.
90100
shell: bash
91-
run: ${{ inputs.composer-command }}
101+
run: >-
102+
composer
103+
${{ inputs.composer-command }}
104+
${{ inputs.composer-flags }}
105+
${{
106+
inputs.ignore-platform-reqs == 'true'
107+
&& '--ignore-platform-reqs'
108+
|| ''
109+
}}

0 commit comments

Comments
 (0)