Configure GitHub Actions for building images#201
Configure GitHub Actions for building images#201samueldr merged 13 commits intoTow-Boot:developmentfrom
Conversation
df04943 to
4470362
Compare
|
I think this is a great addition. It would make it really easy for people not familiar with nix, to still test a PR's builds. |
|
@samueldr gentle ping |
|
Hi, sorry for the delay. I hate piling on apologies, but this might end-up not being needed. I have lined-up something to finish looking into, where we would have a Hydra instance handling CD and CI. By the nature of how it works, and how Tow-Boot is setup, it will be better suited. Note that yes, I agree, having the PRs built is needed and will be helpful. |
d66e99e to
e99a96c
Compare
|
Hi, sorry it took some time until I could get around back to this. Somewhat related to that, announced in the Tow-Boot matrix room, if that helps understand some of the situation, and how I'm moving forward to prevent such a situation to happen again. So, the Hydra infra project that could have been used (from a third party to all of us) is on the ice, in the end, so we'll be using GHA waiting for it to be thawed back. I'll evaluate your changes, determine whether or not there are changes to be made, but will most likely at least keep attribution for the majority of it. I'll be looking into it once the current release is out, since it's already getting a bit long in the tooth, and should be basically ready. |
|
WIP additions here: Alright, so I've looked into it, and added two main things (other than trivial "cleanups"):
Still TODO:
Later, once #238 is in, we'll remove the cheaty thing removing the source tarballs. Since the actually-in-use tree will be easier to point people at. I already removed its removal of config and binaries, since they are useful:
|
|
😆 Nix won't stand for your shenanigans I was curious why it was rebuilding, turns out that yes, cheating is naughty! |
|
Thank you @jirutka, your contributions really helped me hit the ground running, and deal only with details work. I'll be cleaning up my work tomorrow, and pushing this here. It still broadly relies on a lot of what you did. |
- Automatically build images for each device on push and on pull requests. - Upload the built images to the workflow Artifacts. - Upload the built archives to the Release if building a release tag.
This will be replaced by the new "magic cache", which intrinsically handles things for us.
We're now handling this within the Nix expressions. Reducing the things in the proprietary CI tooling helps a lot, since it means the rest can end-up being re-used down the line.
Personal preference, but I think it makes it easier to see what is a logical unit.
This will not be necessary with the upcoming unified tree, and helps make CI easier to deal with.
No need to continue building an outdated PR or push.
Prefer long flags for infrequently used options.
The selected actions are the now preferred options (in my opinion) for installing Nix, and handling caching. Then, stop messing with the store paths, and build the archive as-is. The config and binaries are desirable: - config allows us to see the exact configuration used in the build, and compress nicely - binaries are the artifacts to use to manually flash, necessary under some circumstances where an updater process doesn't exist.
This way the CI should stay evergreen. No forgotten devices.
This differs from a handbuilt `-pre` release. Ideally we'd put the revision ID in there too, but that means no builds ends-up cached.
|
With this push:
I also configured the org to allow the selected action origins The original commit is unchanged [other than a rebase]. |
Please note that I have little to no experience with nix. This workflow works, but the prepare-cache job is quite slow (see the TODO note) and the cache (saved /nix/store) is really big.
Demo: https://github.com/jirutka/Tow-Boot/actions/runs/3177942851
The following Actions need to be enabled in the repo:
actions/upload-artifact@v3,actions/download-artifact@v3, andsoftprops/action-gh-release@v1.