Anybody using Azure pipeline to compile OCaml projects?

I would be interested in azure pipeline scripts to compile some OCaml project on Windows.

I’m afraid I would have to install a whole environment each time the pipeline is triggered?

Best regards

I use GitHub Actions and GitLab CI for OCaml projects on Windows. I suspect that Azure pipelines should be trivial if you use the https://github.com/diskuv/dkml-workflows tool. Just use the “Desktop” scripts in Step 4, and cache the .ci\dkml-compilers directory in your Azure pipeline with something like:

steps:
- task: Cache@2
  inputs:
    key: '"dkml" | "$(Agent.OS)" | workflow.compilers'
    restoreKeys: |
       "dkml" | "$(Agent.OS)"
       "dkml"
    path: .ci/dkml-compilers
  displayName: Cache DkML compilers
- script: ./dk dkml.workflow.compilers CI Desktop
- script: 'ci\setup-dkml\pc\setup-dkml-windows_x86_64.ps1'
- script: "msys64\usr\bin\bash -lc 'ci/build-test.sh'"

You’ll need to create the ci/build-test.sh; the docs will give you one example (https://github.com/diskuv/dkml-workflows-regular-example/blob/4c809caf35853ac465a2bd4be5af9454939297fe/ci/build-test.sh#L1-L73).

The above pipeline YAML will need some work since I’ve never created an Azure pipeline. But if that method works, please tell me how it goes and hopefully I can add it to the documentation.

1 Like

I thank you for your reply. I’m not (yet?) a dkml user, but who knows.

Anyway, your answer is already helpfull: I did not know I could cache things; I’ll check that.

But if that method works, please tell me how it goes and hopefully I can add it to the documentation.

I’ll try not to forget to come back here with some verified scripts once/if I succeed. Not on the top of my TODO list, thought.