pguyot / arm-runner-action

Run tests natively and build images directly from GitHub Actions using a chroot-based virtualized Raspberry Pi (raspios/raspbian) environment
BSD 3-Clause "New" or "Revised" License
156 stars 34 forks source link

is there a way to copy an artifact into the image #123

Open dbieber opened 12 hours ago

dbieber commented 12 hours ago

I have a build process that builds some js with webpack (outside of my image), which I'd like to copy into the arm image. How can I do this?


I see there are options for copying out of the image after commands has run (copy_artifact_path and copy_artifact_dest), but I don't see any options for copying things (other than the repo itself) into the image. And I don't see a way to do so from within commands either, since that runs in the image, and I don't know how to copy from outside the image into the image from there.

dbieber commented 12 hours ago

It looks like I could enable this by adding commands similar to https://github.com/pguyot/arm-runner-action/blob/5864a9437a962fa84b1cd4bb9197a5b81ecf4fa9/action.yml#L219 say at line 221. I could add a new input e.g. inputs.before_commands for commands to run outside the image (but after the repo has already been copied in/mounted) if the maintainers were interested in having that as a feature.

Let me know if there's already an option or another recommended approach that doesn't require modifying the action though.

dbieber commented 12 hours ago

Trying this out in https://github.com/pguyot/arm-runner-action/pull/124. Context: This is in service of https://github.com/dbieber/GoNoteGo/pull/69.


One apparent disadvantage of the approach I've taken so far is steps.mount_image.outputs.mount isn't known in non_image_commands. So it isn't obvious where to copy the artifact to.