-
Notifications
You must be signed in to change notification settings - Fork 332
63 lines (50 loc) · 1.66 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# Prime the caches every Monday
- cron: 0 1 * * MON
workflow_dispatch:
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
ocaml-compiler:
- "5.2.0"
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: ${{ matrix.os != 'macos-latest' }}
opam-repositories: |
pin: git+https://github.com/ocaml/opam-repository#c45f5bab71d3589f41f9603daca5acad14df0ab0
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 update && brew reinstall 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.26.2
- 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'