Skip to content

Commit

Permalink
Add Ocaml CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kupolak committed Jan 24, 2024
1 parent fb7ce62 commit 181b26f
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
pull_request:
branches: [main]

workflow_dispatch:

jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ocaml-base-compiler.4.14.1

- name: Install ocamlformat
run: make install-ocamlformat

- name: Format code
run: opam exec -- dune build @fmt

build:
name: Build and test
needs: [fmt]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- ocaml-base-compiler.4.14.1
steps:
- uses: actions/checkout@v4

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Install opam dependencies
run: opam install --deps-only --with-test .

- name: Build project
run: opam exec -- dune build @install

- name: Run tests
run: opam exec -- dune test

0 comments on commit 181b26f

Please sign in to comment.