ocurrent / ocaml-ci

A CI for OCaml projects
https://ocaml.ci.dev
MIT License
112 stars 74 forks source link

Support for opam lock files. #430

Open tmcgilchrist opened 2 years ago

tmcgilchrist commented 2 years ago

Add support for opam lock files. See opam lock --help

maiste commented 2 years ago

Won't this enter in conflict with the monorepo support as they both used lock files? Is there a way to distinguish between monorepo lock file and opam lock file?

tmcgilchrist commented 1 year ago

Looks like monorepo lock files include metadata for the version etc so we should be ok to support both kinds of lock files.

x-opam-monorepo-root-packages: ["opam-monorepo"]
x-opam-monorepo-version: "0.3"

from https://github.com/tarides/opam-monorepo/blob/main/opam-monorepo.opam.locked#L494-L495

tmcgilchrist commented 1 year ago

Testing libraries and apps have a very different scope, supporting both opam files and lock files together in the same repo would be useful. Opam file is used for release in opam-repository and pinning in opam files. Lock files are used for stable package versions, often for developer use or stable app releases. We should investigate testing both options in ocaml-ci. Currently ocaml-ci will support lock files for monorepo builds but not for ocaml repos. See https://github.com/ocurrent/ocaml-ci/blob/master/lib/analyse.ml#L133-L136

maiste commented 1 year ago

Should we consider having a specific step if a opam lock file is detected? This way, we wouldn't change the behaviour of OCaml-CI and make it possible to test the lock file. WDYT?