-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
GitHub Actions on Windows doesn't stop on error #6668
Comments
hello @justanotheranonymoususer, thank you! we will investigate. |
@justanotheranonymoususer you could slightly modify you workflow and get the same results for Ubuntu and Windows.
|
@justanotheranonymoususer, i am going to close the issue. if you have any questions or concerns, please feel free to reopen. |
You showed a workaround, but the default behavior is still undesired, is
it?
…On Wed, Dec 7, 2022, 12:07 Dusko Dobranic ***@***.***> wrote:
Closed #6668 <#6668> as
completed.
—
Reply to this email directly, view it on GitHub
<#6668 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMDRPCJLHPA5ZLRWA47K5TWMBOWJANCNFSM6AAAAAASQE7TYI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@justanotheranonymoususer it is about default behaviors of the two different shells. for bash, we set 'e' flag which gives exact behavior you are expecting - exit on error. |
I did a couple of other checks. I tried these shells: bash, sh, powershell, pwsh, cmd.
Here's what the docs say:
|
As suggested in actions/runner-images#6668
As suggested in actions/runner-images#6668
GitHub Actions don't check if commands are failing in the workflow while using the default shell (PowerShell). Switch to bash so we don't ignore errors. actions/runner-images#6668
GitHub Actions don't check if any single commands are failing while using the default shell (PowerShell). Switch to bash so we don't ignore errors. actions/runner-images#6668 Fixes #253
@ddobranic how I can achieve the same behavior (to abort) with |
Same issue. Windows passes but linux fails.
|
Should a new bug be filed, or is it possible to re-open this bug? Per this comment, shell |
* Manually fail for Windows RLang tests actions/runner-images#6668 * Quoting changes in Powershell 7.4 actions/runner-images#9115
Summary: Issue #12421 describes a regression in the migration from CircleCI to GitHub Actions in which failing build steps no longer fail Windows CI jobs. In GHA with pwsh (new preferred powershell command), only the last non-builtin command (or something like that) affects the overall success/failure result, and failures in external commands do not exit the script, even with `$ErrorActionPreference = 'Stop'` and `$PSNativeCommandErrorActionPreference = $true`. Switching to `powershell` causes some obscure failure (not seen in CircleCI) about the `-Lo` option to `curl`. Here we work around this using the only reasonable-but-ugly way known: explicitly check the result after every non-trivial build step. This leaves us highly susceptible to future regressions with unchecked build steps in the future, but a clean solution is not known. This change also fixes the build errors that were allowed to creep in because of the CI regression. Also decreased the unnecessarily long running time of DBWriteTest.WriteThreadWaitNanosCounter. For background, this problem explicitly contradicts GitHub's documentation, and GitHub has known about the problem for more than a year, with no evidence of caring or intending to fix. actions/runner-images#6668 Somehow CircleCI doesn't have this problem. And even though cmd.exe and powershell have been perpetuating DOS-isms for decades, they still seem to be a somewhat active "hot mess" when it comes to sensible, consistent, and documented behavior. Fixes #12421 A history of some things I tried in development is here: main...pdillinger:rocksdb:debug_windows_ci_orig Pull Request resolved: #12426 Test Plan: CI, including #12434 where I have temporarily enabled other Windows builds on PR with this change Reviewed By: cbi42 Differential Revision: D54903698 Pulled By: pdillinger fbshipit-source-id: 116bcbebbbf98f347c7cf7dfdeebeaaed7f76827
Summary: Issue facebook#12421 describes a regression in the migration from CircleCI to GitHub Actions in which failing build steps no longer fail Windows CI jobs. In GHA with pwsh (new preferred powershell command), only the last non-builtin command (or something like that) affects the overall success/failure result, and failures in external commands do not exit the script, even with `$ErrorActionPreference = 'Stop'` and `$PSNativeCommandErrorActionPreference = $true`. Switching to `powershell` causes some obscure failure (not seen in CircleCI) about the `-Lo` option to `curl`. Here we work around this using the only reasonable-but-ugly way known: explicitly check the result after every non-trivial build step. This leaves us highly susceptible to future regressions with unchecked build steps in the future, but a clean solution is not known. This change also fixes the build errors that were allowed to creep in because of the CI regression. Also decreased the unnecessarily long running time of DBWriteTest.WriteThreadWaitNanosCounter. For background, this problem explicitly contradicts GitHub's documentation, and GitHub has known about the problem for more than a year, with no evidence of caring or intending to fix. actions/runner-images#6668 Somehow CircleCI doesn't have this problem. And even though cmd.exe and powershell have been perpetuating DOS-isms for decades, they still seem to be a somewhat active "hot mess" when it comes to sensible, consistent, and documented behavior. Fixes facebook#12421 A history of some things I tried in development is here: facebook/rocksdb@main...pdillinger:rocksdb:debug_windows_ci_orig Pull Request resolved: facebook#12426 Test Plan: CI, including facebook#12434 where I have temporarily enabled other Windows builds on PR with this change Reviewed By: cbi42 Differential Revision: D54903698 Pulled By: pdillinger fbshipit-source-id: 116bcbebbbf98f347c7cf7dfdeebeaaed7f76827
Summary: Issue facebook#12421 describes a regression in the migration from CircleCI to GitHub Actions in which failing build steps no longer fail Windows CI jobs. In GHA with pwsh (new preferred powershell command), only the last non-builtin command (or something like that) affects the overall success/failure result, and failures in external commands do not exit the script, even with `$ErrorActionPreference = 'Stop'` and `$PSNativeCommandErrorActionPreference = $true`. Switching to `powershell` causes some obscure failure (not seen in CircleCI) about the `-Lo` option to `curl`. Here we work around this using the only reasonable-but-ugly way known: explicitly check the result after every non-trivial build step. This leaves us highly susceptible to future regressions with unchecked build steps in the future, but a clean solution is not known. This change also fixes the build errors that were allowed to creep in because of the CI regression. Also decreased the unnecessarily long running time of DBWriteTest.WriteThreadWaitNanosCounter. For background, this problem explicitly contradicts GitHub's documentation, and GitHub has known about the problem for more than a year, with no evidence of caring or intending to fix. actions/runner-images#6668 Somehow CircleCI doesn't have this problem. And even though cmd.exe and powershell have been perpetuating DOS-isms for decades, they still seem to be a somewhat active "hot mess" when it comes to sensible, consistent, and documented behavior. Fixes facebook#12421 A history of some things I tried in development is here: facebook/rocksdb@main...pdillinger:rocksdb:debug_windows_ci_orig Pull Request resolved: facebook#12426 Test Plan: CI, including facebook#12434 where I have temporarily enabled other Windows builds on PR with this change Reviewed By: cbi42 Differential Revision: D54903698 Pulled By: pdillinger fbshipit-source-id: 116bcbebbbf98f347c7cf7dfdeebeaaed7f76827
Summary: Issue #12421 describes a regression in the migration from CircleCI to GitHub Actions in which failing build steps no longer fail Windows CI jobs. In GHA with pwsh (new preferred powershell command), only the last non-builtin command (or something like that) affects the overall success/failure result, and failures in external commands do not exit the script, even with `$ErrorActionPreference = 'Stop'` and `$PSNativeCommandErrorActionPreference = $true`. Switching to `powershell` causes some obscure failure (not seen in CircleCI) about the `-Lo` option to `curl`. Here we work around this using the only reasonable-but-ugly way known: explicitly check the result after every non-trivial build step. This leaves us highly susceptible to future regressions with unchecked build steps in the future, but a clean solution is not known. This change also fixes the build errors that were allowed to creep in because of the CI regression. Also decreased the unnecessarily long running time of DBWriteTest.WriteThreadWaitNanosCounter. For background, this problem explicitly contradicts GitHub's documentation, and GitHub has known about the problem for more than a year, with no evidence of caring or intending to fix. actions/runner-images#6668 Somehow CircleCI doesn't have this problem. And even though cmd.exe and powershell have been perpetuating DOS-isms for decades, they still seem to be a somewhat active "hot mess" when it comes to sensible, consistent, and documented behavior. Fixes #12421 A history of some things I tried in development is here: main...pdillinger:rocksdb:debug_windows_ci_orig Pull Request resolved: #12426 Test Plan: CI, including #12434 where I have temporarily enabled other Windows builds on PR with this change Reviewed By: cbi42 Differential Revision: D54903698 Pulled By: pdillinger fbshipit-source-id: 116bcbebbbf98f347c7cf7dfdeebeaaed7f76827
This is so that the scripts can fail if commands return non-zero. Cmd happily continues and never returns failures. Ref actions/runner-images#6668
It's important for windows to fail correctly. Further: actions/runner-images#6668 Signed-off-by: Tim Zhang <[email protected]>
Description
Here's a pipeline which demonstrates the bug, it should fail but it keeps on running, leading to unexpected consequences in the rest of the pipeline:
Here's a more complete example:
https://github.com/justanotheranonymoususer/actions-test/blob/5c0935375762cfbcc8f6231aae60c50a6c2b284b/.github/workflows/blank.yml
Execution result:
https://github.com/justanotheranonymoususer/actions-test/actions/runs/3569092631
You can see that on ubuntu-latest, it fails properly, but in windows-latest, it doesn't fail even though it should.
Platforms affected
Runner images affected
Image version and build link
windows-latest
Is it regression?
Not/don't know
Expected behavior
Windows pipeline fails on first error
Actual behavior
Windows pipeline keeps running
Repro steps
See pipeline in the description
The text was updated successfully, but these errors were encountered: