Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Sep 17, 2021

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Aug 6, 2021

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 in the workflow summary, the workflow will not be marked as failed, nor will the individual test builds be marked as failed.

If we look back at the last time the workflow was run completely, this can be seen in the annotations below the summary, which show that the Windows test runs all failed.
https://github.com/phpDocumentor/ReflectionDocBlock/actions/runs/370378454

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

Opening as draft to expose issue #287 properly.

@jaapio
Copy link
Member

jaapio commented Aug 8, 2021

@jrfnl could you please update this pr?

@jrfnl jrfnl force-pushed the ghactions-fail-on-failing-test branch from 95d40e5 to 9f81c8d Compare August 8, 2021 19:51
@jrfnl
Copy link
Contributor Author

jrfnl commented Aug 8, 2021

@jaapio Rebased. Still in draft due to issue #287 needing solving first.

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 in the workflow summary, the workflow will not be marked as failed, nor will the individual test builds be marked as failed.

If we look back at the last time the workflow was run completely, this can be seen in the annotations below the summary, which show that the Windows test runs all failed.
https://github.com/phpDocumentor/ReflectionDocBlock/actions/runs/370378454

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".
@jrfnl jrfnl force-pushed the ghactions-fail-on-failing-test branch from 9f81c8d to 63aa020 Compare August 8, 2021 20:30
@jaapio
Copy link
Member

jaapio commented Sep 17, 2021

@jrfnl #287 has been closed. I think this pr can be rebased and merged? Or do you want to introduce some more changes before merging this?

@jaapio jaapio marked this pull request as ready for review September 17, 2021 13:23
@jaapio jaapio merged commit be3b495 into phpDocumentor:master Sep 17, 2021
@jrfnl jrfnl deleted the ghactions-fail-on-failing-test branch September 17, 2021 13:56
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.

None yet

2 participants