juspay / omnix

🚧 A Nix wrapper to improve developer experience
https://omnix.page
GNU Affero General Public License v3.0
70 stars 5 forks source link

`om ci`: Allow running arbitrary apps in CI #198

Closed srid closed 2 weeks ago

srid commented 1 month ago

Original requirement: https://github.com/srid/nixci/issues/86

We can perhaps leverage flake-schemas here to add special "CI apps" that om ci can automatically run in addition to build derivations.

We shall use this to replace the following:

https://github.com/juspay/omnix/blob/2aa1f48783b9757e87e9c54f5f250bb56384f066/.github/workflows/ci.yaml#L37-L39

https://github.com/juspay/omnix/blob/2aa1f48783b9757e87e9c54f5f250bb56384f066/.github/workflows/ci.yaml#L59-L69

Open question: how do we pass arguments, like github secrets? cf.

https://github.com/juspay/omnix/blob/2aa1f48783b9757e87e9c54f5f250bb56384f066/.github/workflows/ci.yaml#L51-L58

srid commented 2 weeks ago

I prototyped the below spec, which works when running CI locally, but not when running it remotely through --on. That makes sense, because this design assumes that the project is checked out in current directory, whereas remote builds use $HOME as the current directory (and the flake points to read-only nix store path):

image

So the solution is tighten the spec to support specific run cases, viz.: "run the given flake app" and "run this command in the given flake devShell".

srid commented 2 weeks ago

Now looks like:

image