From aa6e024a559bca72af3777800243401e861578ae Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 31 Jul 2021 12:35:00 +0200 Subject: [PATCH] GH Actions: fail the build if a test run fails The way things were set up now in the `phpunit` job, no matter whether tests passed or failed, the workflow would always continue. I suspect this may have been set-up this way to make sure that all variations of test runs will actually be run ? The downside is that, while you will see a :x: for the individual build, the workflow will not be marked as failed if a test runs fails. I'm proposing to change this now by: * Removing the `continue-on-error` for the test run. * Adding the `fail-fast` key and setting it to `false`. By default this key is set to `true`, which means that if any individual build within the job fails, all other builds within the job will be cancelled. By setting it to `false`, all builds in the matrix will still be run, but if any of them fail, the workflow will be marked as "failed". --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6a8cba3..b3db0f3 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -85,6 +85,7 @@ jobs: phpunit: runs-on: ${{ matrix.operating-system }} strategy: + fail-fast: false matrix: operating-system: - ubuntu-latest @@ -130,7 +131,6 @@ jobs: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader - name: Run PHPUnit - continue-on-error: true run: php tools/phpunit codestyle: