From 07e5cdf26fbf4f107ebf06b73f8e420b1b2867db Mon Sep 17 00:00:00 2001 From: lexa Date: Tue, 4 Feb 2025 17:48:02 +0100 Subject: [PATCH] Configure CI (#10) * 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 --- .github/workflows/CI.yml | 58 ++++++++++++++++++++++++++++++++++++++++ .ocamlformat | 3 ++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..1573b99 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,58 @@ +# Based on the example workflow of the Set Up OCaml action +# + +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 diff --git a/.ocamlformat b/.ocamlformat index fa4af5a..d07dcad 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1 +1,2 @@ -profile=janestreet \ No newline at end of file +profile=janestreet +version=0.27.0