Skip to content

Commit

Permalink
Configure CI (#10)
Browse files Browse the repository at this point in the history
* Create CI.yml

This adds CI using the Set Up OCaml GitHub action.
Handles doc and formatting linting.

* Remove `on: push`

This creates duplicates. `pull_request` is enough.

* Pin ocamlformat's version to make the CI happy
  • Loading branch information
qexat authored Feb 4, 2025
1 parent 7a177cf commit 07e5cdf
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
58 changes: 58 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Based on the example workflow of the Set Up OCaml action
# <https://github.com/marketplace/actions/set-up-ocaml>

name: CI

on:
- pull_request

permissions: read-all

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest

runs-on: ${{ matrix.os }}

steps:
- name: Checkout tree
uses: actions/checkout@v4

- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5

- run: opam install . --deps-only --with-test

- run: opam exec -- dune build

- run: opam exec -- dune runtest

lint-doc:
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@v4
- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5
- uses: ocaml/setup-ocaml/lint-doc@v3

lint-fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout tree
uses: actions/checkout@v4
- name: Set-up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5
- uses: ocaml/setup-ocaml/lint-fmt@v3
3 changes: 2 additions & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
profile=janestreet
profile=janestreet
version=0.27.0

0 comments on commit 07e5cdf

Please sign in to comment.