Skip to content
GitHub Action for the OCaml programming language
JavaScript TypeScript Shell Batchfile
Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
Branch: master
Clone or download
Latest commit d69c274 Nov 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Support ocaml-version across all operating systems Nov 19, 2019
__tests__ port the old GitHub Actions code to the new TypeScript world Nov 19, 2019
lib correct paths to dirname Nov 20, 2019
node_modules port the old GitHub Actions code to the new TypeScript world Nov 19, 2019
src
.gitignore port the old GitHub Actions code to the new TypeScript world Nov 19, 2019
LICENSE
README.md update README Nov 21, 2019
action.yml add icon Nov 20, 2019
jest.config.js Initial commit Nov 10, 2019
package-lock.json refresh skeleton Nov 10, 2019
package.json port the old GitHub Actions code to the new TypeScript world Nov 19, 2019
tsconfig.json Initial commit Nov 10, 2019

README.md

Create an OCaml Action

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

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

You can’t perform that action at this time.