Skip to content

Commit 528c08e

Browse files
committed
GH Actions: fail "setup-php" if requested tooling could not be installed
Setup-PHP will normally "gracefully" show a warning and not the build when an extension or tool failed to install. This is not particularly useful as that means that either there will be a failure later on in the build due to the extension or tool missing, or the build will not be representative of what is supposed to be tested. This commit changes this behaviour to fail the build at the `setup-php` step, which also makes debugging these type of build failures much more straight-forward. Ref: https://github.com/shivammathur/setup-php?tab=readme-ov-file#fail-fast-optional
1 parent cff81cb commit 528c08e

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

.github/workflows/cs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ jobs:
9292
php-version: 'latest'
9393
coverage: none
9494
tools: cs2pr
95+
env:
96+
fail-fast: true
9597

9698
# Validate the composer.json file.
9799
# @link https://getcomposer.org/doc/03-cli.md#validate

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ jobs:
6262
with:
6363
php-version: 7.4
6464
coverage: none
65+
env:
66+
fail-fast: true
6567

6668
# This action also handles the caching of the Yarn dependencies.
6769
# https://github.com/actions/setup-node

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ jobs:
9494
ini-values: zend.assertions=1, assert.exception=1, error_reporting=-1, display_errors=On, display_startup_errors=On
9595
coverage: none
9696
tools: cs2pr
97+
env:
98+
fail-fast: true
9799

98100
# Install dependencies and handle caching in one go.
99101
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ jobs:
9595
php-version: ${{ matrix.php_version }}
9696
ini-values: zend.assertions=1, assert.exception=1, error_reporting=-1, display_errors=On, display_startup_errors=On
9797
coverage: ${{ matrix.coverage == true && 'xdebug' || 'none' }}
98+
env:
99+
fail-fast: true
98100

99101
# Install dependencies and handle caching in one go.
100102
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
@@ -197,6 +199,8 @@ jobs:
197199
php-version: ${{ matrix.php_version }}
198200
ini-values: zend.assertions=1, assert.exception=1, error_reporting=-1, display_errors=On, display_startup_errors=On
199201
coverage: ${{ matrix.coverage == true && 'xdebug' || 'none' }}
202+
env:
203+
fail-fast: true
200204

201205
# Install dependencies and handle caching in one go.
202206
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer

0 commit comments

Comments
 (0)