action-build icon indicating copy to clipboard operation
action-build copied to clipboard

Fail action when the build fails to produce the exact number of snaps requested

Open Hook25 opened this issue 8 months ago • 1 comments

Description

In checkbox we use this action to trigger remote builds via snapcraft. Right now we don't get any failure out of it even when it actually should fail because as long as at least one snap is produced the action will pass (Snapcraft never returns 1 due toremote-build failing). This is a problem in general, but specifically right now we are dealing with some flaky builds and we are unable to retry them because we have no way of knowing if snapcraft failed or not.

This introduces a new check after a build is done, comparing the amount of requested artifacts (namely: 1 for any build that does not include a --build-(on|for)) against the number that is actually produced. If the two differ, an error is raised

Testing

This introduces two new tests (and fixes the text for 0 snaps), to test that a mismatch between requested and produced always fails. I have tested this contribution via npm test and npm run all

Hook25 avatar Oct 25 '23 11:10 Hook25