ocurrent / ocaml-ci

A CI for OCaml projects
https://ocaml.ci.dev
111 stars 75 forks source link

Add additional opam-repository / Dockerfile customization? #921

Open gpetiot opened 6 months ago

gpetiot commented 6 months ago

Is there a way to tell ocaml-ci to do opam repository add ... to add another repository to fetch packages from?

gpetiot commented 5 months ago

Maybe I could reframe this question as: would it be possible to customize the dockerfiles generated by ocaml-ci, here is the kind of workflow I would like to have: https://github.com/tarides/okra/blob/main/.github/workflows/build.yml (the opam-repositories customization is what I mostly need)

benmandrew commented 5 months ago

This is technically possible, but as OCaml-CI is currently zero-configuration we have no way of getting a user config. This would have to be added in some kind of new .ocamlci file or something.

At the moment we're not actively developing OCaml-CI, but you're free to open a PR if you'd like.

samoht commented 4 months ago

The way to make this happen is to add a new field in opam of dune-project to be able to specify what upstream repository to use. This way that will work both on developer machines and in the CI (so there is no need to create a .ocamlci configuration file - I suggest we resist the urge to do this and fix our other metadata sources first :p)

So, now, the issue is that there is no way to specify extra repositories in opam files. Fortunately, that's something that is being added in the dune pkg command where you would be able to specify with opam-repository to use directly in your dune-project file, so I suspect it might be possible to test this somehow one day in ocaml-ci /cc @leostera and @tmattio