Skip to content

Commit 65a1350

Browse files
dingo-djrfnl
andauthored
GH Actions: fail "setup-php" if requested tooling could not be installed (#2769)
Setup-PHP will normally "gracefully" show a warning and not fail the build when an extension or tool failed to install. In most cases, 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 select builds 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 Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2 parents ec2ff94 + 147ffe1 commit 65a1350

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/basic-qa.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ jobs:
168168
# Allow for PHP deprecation notices.
169169
ini-values: error_reporting = E_ALL & ~E_DEPRECATED
170170
coverage: none
171+
env:
172+
fail-fast: true
171173

172174
- name: "Composer: set PHPCS dependencies for tests (dev)"
173175
if: ${{ matrix.dependencies == 'dev' }}
@@ -250,6 +252,8 @@ jobs:
250252
php-version: 'latest'
251253
coverage: none
252254
tools: phpstan:1.x
255+
env:
256+
fail-fast: true
253257

254258
# Install dependencies and handle caching in one go.
255259
# Dependencies need to be installed to make sure the PHPCS and PHPUnit classes are recognized.

.github/workflows/quicktest.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
4343
ini-values: error_reporting=-1, display_errors=On, display_startup_errors=On
4444
coverage: ${{ github.ref_name == 'develop' && 'xdebug' || 'none' }}
45+
env:
46+
fail-fast: true
4547

4648
- name: Enable creation of `composer.lock` file
4749
if: ${{ matrix.dependencies == 'lowest' }}

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ jobs:
9696
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
9797
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
9898
tools: cs2pr
99+
env:
100+
fail-fast: true
99101

100102
- name: "Composer: set PHPCS dependencies for tests (dev)"
101103
if: ${{ matrix.dependencies == 'dev' }}

0 commit comments

Comments
 (0)