# GitHub Actions for OCaml / opam now available

**URL:** <https://discuss.ocaml.org/t/github-actions-for-ocaml-opam-now-available/4745>\
**Category:** Ecosystem\
**Tags:** ci, opam, announce\
**Created:** [November 21, 2019, 2:44pm UTC](https://discuss.ocaml.org/t/github-actions-for-ocaml-opam-now-available/4745 "2019-11-21T14:44:50Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![avsm](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/avsm/32/6_2.png) [@avsm](https://discuss.ocaml.org/u/avsm)\
**Post date:** [November 21, 2019, 2:44pm UTC](https://discuss.ocaml.org/t/github-actions-for-ocaml-opam-now-available/4745/1 "2019-11-21T14:44:50Z")

</div>

I was in the [GitHub Actions](https://github.com/actions) beta program and forward ported my code to the latest version that just went public. It’s a pretty simple way to get your OCaml code tested on Linux, macOS and Windows, without requiring an external CI service. The action attempts to provide a homogenous interface across all three operating systems, so invoking ‘opam’ from subsequent actions should “just work”.

You can find it here:

- In the GitHub Marketplace at [https://github.com/marketplace/actions/setup-ocaml](https://github.com/marketplace/actions/setup-ocaml)
- Source code on [https://github.com/avsm/setup-ocaml/](https://github.com/avsm/setup-ocaml/)
- Hello World usage on [https://github.com/avsm/hello-world-action-ocaml](https://github.com/avsm/hello-world-action-ocaml)
- Usage in ocaml-yaml:
  - [https://github.com/avsm/ocaml-yaml/blob/master/.github/workflows/test.yml](https://github.com/avsm/ocaml-yaml/blob/master/.github/workflows/test.yml)
  - An [example ocaml-yaml run](https://github.com/avsm/ocaml-yaml/runs/314055554)

This should be considered fairly experimental as GH Actions is so new. If you do use it, then consider [updating this issue with your usage](https://github.com/avsm/setup-ocaml/issues/4). It does not current supporting caching yet, but is pretty fast to bootstrap (~4minutes).

It also doesn’t have any higher level purpose other than to set up an opam environment, since most of the additional functionality such as revdeps testing is planned for addition to the [ocurrent DSL](https://discuss.ocaml.org/t/ann-ocurrent-0-1-ci-cd-pipeline-edsl/4742/2). Nevertheless, this GH feature will hopefully be useful for smaller projects without a lot of computational requirements. Let me know how it goes!

Windows is currently supported through @fdopen’s excellent fork that uses Cygwin. As Windows support is being mainlined into opam itself at the moment, I’m hoping that we will gradually move over to that. That should eventually remove the need for two separate opam-repositories, so I won’t be adding any features that are Linux or macOS-specific and do not work on the Cygwin version.

---

_[View the full topic](https://discuss.ocaml.org/t/github-actions-for-ocaml-opam-now-available/4745)._
