Skip to content

GitHub Action for the OCaml programming language

License

Notifications You must be signed in to change notification settings

SDAChess/setup-ocaml

 
 

Repository files navigation

Create an OCaml Action

Use this template to bootstrap the creation of an OCaml action.:rocket:

This template installs the opam on Ubuntu Linux, macOS and Windows for use with GitHub Actions.

If you are new, there's also a simpler introduction. See the Hello World OCaml Action that uses Dune and opam to build a simple library.

Inputs

  • ocaml-version: the full version of the OCaml compiler (default 4.08.1)

Action

The action does the following:

  • Ubuntu: Installs the latest opam with sandboxing active
  • macOS: Installs the latest opam from Homebrew with sandboxing active
  • Windows: Installs Cygwin and the fdopen fork with mingw64c

The repository is initialised to the default one, and then the following plugins are installed:

  • opam-depext

The opam binary is added to the PATH for subsequent actions, so that executing opam commands will just work after that.

Example workflow

name: Build Hello World executable
on: [push]
jobs:
  run:
    name: Build
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system: [macos-latest, ubuntu-latest, windows-latest]
        ocaml-version: [ '4.09.0', '4.08.1' ]
    steps:
    - uses: actions/checkout@master
    - uses: avsm/setup-ocaml@master
      with:
        ocaml-version: ${{ matrix.ocaml-version }}
    - run: opam pin add hello.dev -n .
    - run: opam depext -yt hello
    - run: opam install -t . --deps-only
    - run: opam exec -- dune build
    - run: opam exec -- dune runtest

Roadmap

This action aims to provide an OS-neutral interface to opam, and so will not add features that only work on one operating system. It will also track the latest stable release of opam.

Discussions: https://discuss.ocaml.org/t/github-actions-for-ocaml-opam-now-available/4745

About

GitHub Action for the OCaml programming language

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 47.7%
  • TypeScript 25.8%
  • Shell 20.6%
  • Batchfile 5.9%