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

Fix: GitHub build workflow now will error on fail and use matrix configuration #103

Conversation

mitchcapper
Copy link

Fixes #86
Build script will also throw error now if invalid arch specified.

While checking to make sure the exe builds that seemed like more of a hack, as the build process itself was erroring out but GH actions was thinking that step was a success.

I don't use GH actions much either but after some tracing it was apparent. The build script calls the pwsh shell and passes multiple commands to it. PWSH will only return the exit code of the entire command it is running but not fail if one of the exit codes is non-zero.

There was no apparent option to fix this, could move the commands for a step to a powershell file and then use $ErrorActionPreference = 'Stop' but would still need to check the exit code for any non-powershell calls manually.

Instead I just converted each step to run a single command which should have the desired result.

A quick test seems to work: https://github.com/mitchcapper/dnSpy/actions/runs/2654844926

In addition by switching to the matrix configuration builds will complete 3x faster and no need for the cleanup in between as jobs each have their own parallel runner.

build.ps1 Outdated Show resolved Hide resolved
@mitchcapper mitchcapper force-pushed the fix_workflow_should_fail_on_build_error_pr branch from 9f6b8e2 to 887c659 Compare July 12, 2022 17:16
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
Fixes dnSpyEx#86
Switch to matrix use to simplify build and speed up process
@mitchcapper mitchcapper force-pushed the fix_workflow_should_fail_on_build_error_pr branch from 887c659 to b3d5566 Compare July 18, 2022 20:25
@mitchcapper
Copy link
Author

all set.

@ElektroKill ElektroKill merged commit 6ba623e into dnSpyEx:master Jul 19, 2022
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.

CI actions are 'successful' despite failing and produce incomplete artifacts
2 participants