Skip to content

GH Actions: fail the build if a test run fails - #43

Merged
jaapio merged 1 commit into
phpDocumentor:2.xfrom
jrfnl:feature/ghactions-fail-on-failing-test
Aug 6, 2021
Merged

jaapio merged 1 commit into
phpDocumentor:2.xfrom
jrfnl:feature/ghactions-fail-on-failing-test

Conversation

@jrfnl

@jrfnl jrfnl commented Jul 31, 2021

Copy link
Copy Markdown
Contributor

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 ❌ 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".

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 ❌ 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".
@jaapio
jaapio merged commit fe369ab into phpDocumentor:2.x Aug 6, 2021
@jrfnl
jrfnl deleted the feature/ghactions-fail-on-failing-test branch August 6, 2021 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants