Fix: GitHub build workflow now will error on fail and use matrix configuration #103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.