Skip to content

CI

CI #161

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# Prime the caches every Monday
- cron: 0 1 * * MON
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- ocaml-base-compiler.4.14.1
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#8cc107f96e33a4601f7c39346eb19fbbe46486d3
opam-disable-sandboxing: true
- name: Install system dependencies (Linux)
run: sudo apt update && sudo apt-get install libev-dev libonig-dev libcurl4-openssl-dev
if: runner.os == 'Linux'
- name: Install system dependencies (macOS)
run: brew install libev openssl@3 # Openssl is a workaround for https://github.com/ocaml/opam-repository/issues/19676
if: runner.os == 'macOS'
- name: Install opam dependencies
run: opam install --deps-only --with-test .
- name: Install ocamlformat
run: opam install ocamlformat.0.25.1
- name: Build project
run: opam exec -- dune build @install
- name: Run tests
run: opam exec -- dune test
- name: Format code
run: opam exec -- dune build --auto-promote @fmt
if: runner.os == 'Linux'