Skip to content

Conversation

@Hook25
Copy link

@Hook25 Hook25 commented Oct 25, 2023

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

@jhenstridge
Copy link
Collaborator

As the description of the input mentions, snapcraft-args was intended to let a snap opt into experimental features:

https://github.com/snapcore/action-build/blob/96195148af52105f8a203a3abe867c8aea0eea79/action.yml#L31-L38

It is not intended to let you run arbitrary snapcraft commands, and doing so is an unsupported configuration. Given that most of the code in this action deals with wrangling the build environment to get LXD working (which isn't needed by snapcraft remote-build), you might be better off not using the action at all.

If you just want snapcraft available for your job, you can run sudo snap install --classic snapcraft in a step.

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.

2 participants