Skip to content

Commit 6ae263f

Browse files
jeong-sikclaude
andauthored
ci: add GitHub Actions CI (build + test + lint) (#31)
- Matrix: OCaml 5.2/5.3 on ubuntu+macos, 5.4 on ubuntu - Build + test with dune - Lint: verify opam files stay in sync with dune-project Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c33aa14 commit 6ae263f

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
name: Build and Test
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, macos-latest]
20+
ocaml-compiler: ['5.2', '5.3']
21+
include:
22+
- os: ubuntu-latest
23+
ocaml-compiler: '5.4'
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up OCaml ${{ matrix.ocaml-compiler }}
29+
uses: ocaml/setup-ocaml@v3
30+
with:
31+
ocaml-compiler: ${{ matrix.ocaml-compiler }}
32+
33+
- name: Install dependencies
34+
run: opam install . --deps-only --with-test
35+
36+
- name: Build
37+
run: opam exec -- dune build
38+
39+
- name: Run tests
40+
run: opam exec -- dune runtest
41+
42+
lint:
43+
name: Lint
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Set up OCaml
49+
uses: ocaml/setup-ocaml@v3
50+
with:
51+
ocaml-compiler: '5.4'
52+
53+
- name: Install dependencies
54+
run: opam install . --deps-only
55+
56+
- name: Check opam files are up to date
57+
run: opam exec -- dune build @install && git diff --exit-code *.opam

0 commit comments

Comments
 (0)