Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Tell github that .ml and .mli files are OCaml
*.ml linguist-language=OCaml
*.mli linguist-language=OCaml

# Disable syntax detection for cram tests
*.t linguist-language=Text
9 changes: 9 additions & 0 deletions .github/crs-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://github.com/mbarbin/crs/releases/download/0.0.20260307/crs-config.schema.json",
"default_repo_owner": "mbarbin",
"user_mentions_allowlist": [
"mbarbin"
],
"invalid_crs_annotation_severity": "Error",
"crs_due_now_annotation_severity": "Info"
}
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: ci

on:
push:
branches:
- main
pull_request:
branches:
- "**" # This will match pull requests targeting any branch

permissions:
contents: read

jobs:
build:
name: CI
runs-on: ubuntu-latest
env:
OCAML_VERSION: "5.5"
DUNE_VERSION: "3.24.2"
DUNE_DIGEST: "sha256:3a9cac891f0b6086bfbf58d16c6c17ddfd1d493e031b6b43901f585a7f6899c7"
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Environment setup
run: |
echo "DUNE_WORKSPACE=$PWD/dune-workspace.${{ env.OCAML_VERSION }}" >> "$GITHUB_ENV"

- name: Setup Dune
uses: mbarbin/setup-dune@03ede0220d3fe665f250727d8e21b7c0f9517f3b # v2.0.0+patch-7
env:
GH_TOKEN: ${{ github.token }}
with:
version: "${{ env.DUNE_VERSION }}"
dune-digest: "${{ env.DUNE_DIGEST }}"
workspace: "${{ env.DUNE_WORKSPACE }}"
cache-prefix: "main-ci-${{ env.OCAML_VERSION }}"
cache-readonly: ${{ github.ref != 'refs/heads/main' }}
steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts

- name: Build and Run tests
run: |
mkdir $BISECT_DIR
dune build @all @runtest
dune build @runtest --force --instrument-with bisect_ppx
env:
BISECT_DIR: ${{ runner.temp }}/_bisect_ppx_data
BISECT_FILE: ${{ runner.temp }}/_bisect_ppx_data/data

- name: Lint
run: dune build @lint @fmt @unused-libs

- name: Build Doc
run: dune build @doc

- name: Check for uncommitted changes
run: git diff --exit-code
28 changes: 28 additions & 0 deletions .github/workflows/crs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CRs Workflows

on:
pull_request:
branches:
- "**" # This will match pull requests targeting any branch

permissions:
contents: read
pull-requests: write

jobs:
crs-workflows:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install crs
uses: mbarbin/crs-actions/setup-crs@1496bc422fe27b357d6354ab494e922f6a2b061f # v1.0.0-alpha.13
with:
crs-version: "0.0.20260307"
crs-digest: "sha256:5097e709386d8d41351a87f86c8ad374db72aabe4ddc2a8ff2d58faebb1b889f"

- name: Summarize CRs in PR
uses: mbarbin/crs-actions/summarize-crs-in-pr@1496bc422fe27b357d6354ab494e922f6a2b061f # v1.0.0-alpha.13
with:
crs-config: .github/crs-config.json
86 changes: 86 additions & 0 deletions .github/workflows/deploy-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: deploy-doc

on:
push:
branches:
- main

permissions:
contents: read

jobs:
build:
name: Build documentation
runs-on: ubuntu-latest

env:
MDBOOK_VERSION: "0.5.2"
MDBOOK_DIGEST: "sha256:b7ab218618bb3c1715e3e1759cfa0abc56dcd7ab5d90f60dcd86d708c87b715d"
ZOLA_VERSION: "0.22.1"
ZOLA_DIGEST: "sha256:45de6b2559aba4df42199dc6b0161acb914d37be4ccaa03297cd4a26c8e14042"

defaults:
run:
shell: bash

steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Cache mdbook binary
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
id: mdbook-cache
with:
path: ~/.local/bin/mdbook
key: "mdbook-${{ env.MDBOOK_VERSION }}-${{ runner.os }}-${{ runner.arch }}-${{ env.MDBOOK_DIGEST }}"

- name: Install mdbook
env:
BINARY_CACHE_HIT: ${{ steps.mdbook-cache.outputs.cache-hit }}
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
bash actions/install-mdbook.sh

- name: Cache zola binary
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
id: zola-cache
with:
path: ~/.local/bin/zola
key: "zola-${{ env.ZOLA_VERSION }}-${{ runner.os }}-${{ runner.arch }}-${{ env.ZOLA_DIGEST }}"

- name: Install zola
env:
BINARY_CACHE_HIT: ${{ steps.zola-cache.outputs.cache-hit }}
run: |
bash actions/install-zola.sh

- name: Build documentation
run: make -C doc build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: doc/public

deploy:
name: Deploy to GitHub Pages
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
72 changes: 72 additions & 0 deletions .github/workflows/dune-pkg-more-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Additional CI workflow using setup-dune (dune package management).
#
# This tests across multiple operating systems and OCaml versions, but skips
# steps not necessary for every combination (linting, coverage, etc.).

name: dune-pkg-more-ci

on:
push:
branches:
- main
pull_request:
branches:
- "**"

permissions:
contents: read

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
ocaml-version:
- "5.5"
- "5.4"
- "5.3"
include:
- os: ubuntu-latest
dune-version: "3.24.2"
dune-digest: "sha256:3a9cac891f0b6086bfbf58d16c6c17ddfd1d493e031b6b43901f585a7f6899c7"
- os: macos-latest
dune-version: "3.24.2"
dune-digest: "sha256:d4aa0d58370bb86e1f3f74635d9f7b69fd635fefe159173add82e851e85d12b2"
exclude:
# Exclude the combination already tested in the main ci workflow.
- os: ubuntu-latest
ocaml-version: "5.5"

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

defaults:
run:
shell: bash

steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Environment setup
run: |
echo "DUNE_WORKSPACE=$PWD/dune-workspace.${{ matrix.ocaml-version }}" >> "$GITHUB_ENV"
echo "PACKAGES=central,central-tests" >> "$GITHUB_ENV"

- name: Setup Dune
uses: mbarbin/setup-dune@03ede0220d3fe665f250727d8e21b7c0f9517f3b # v2.0.0+patch-7
env:
GH_TOKEN: ${{ github.token }}
with:
version: "${{ matrix.dune-version }}"
dune-digest: "${{ matrix.dune-digest }}"
workspace: "${{ env.DUNE_WORKSPACE }}"
cache-prefix: "${{ matrix.ocaml-version }}"
cache-readonly: ${{ github.ref != 'refs/heads/main' }}
only-packages: ${{ env.PACKAGES }}
steps: install-dune enable-pkg lazy-update-depexts install-gpatch install-depexts

- name: Build & Run tests
run: dune build @all @runtest --only-packages=${{ env.PACKAGES }}
28 changes: 28 additions & 0 deletions .github/workflows/dunolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Dunolint Workflows

on:
push:
branches:
- main
pull_request:
branches:
- "**" # This will match pull requests targeting any branch

permissions:
contents: read

jobs:
dunolint-workflows:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install dunolint
uses: mbarbin/dunolint-actions/setup-dunolint@ddc2b3ee5e8e5558d74c68643c63d37c11eb7279 # v1.0.0-alpha.6
with:
dunolint-version: "0.0.20260306"
dunolint-digest: "sha256:b83c07dd352cd4bec36b872ac593f299972710baff70a62e7a4650e80d2460d4"

- name: Lint Check
uses: mbarbin/dunolint-actions/lint-check@ddc2b3ee5e8e5558d74c68643c63d37c11eb7279 # v1.0.0-alpha.6
58 changes: 58 additions & 0 deletions .github/workflows/test-deploy-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: test-deploy-doc

on:
pull_request:
branches:
- main

permissions:
contents: read

jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest

env:
MDBOOK_VERSION: "0.5.2"
MDBOOK_DIGEST: "sha256:b7ab218618bb3c1715e3e1759cfa0abc56dcd7ab5d90f60dcd86d708c87b715d"
ZOLA_VERSION: "0.22.1"
ZOLA_DIGEST: "sha256:45de6b2559aba4df42199dc6b0161acb914d37be4ccaa03297cd4a26c8e14042"

defaults:
run:
shell: bash

steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Cache mdbook binary
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
id: mdbook-cache
with:
path: ~/.local/bin/mdbook
key: "mdbook-${{ env.MDBOOK_VERSION }}-${{ runner.os }}-${{ runner.arch }}-${{ env.MDBOOK_DIGEST }}"

- name: Install mdbook
env:
BINARY_CACHE_HIT: ${{ steps.mdbook-cache.outputs.cache-hit }}
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
bash actions/install-mdbook.sh

- name: Cache zola binary
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
id: zola-cache
with:
path: ~/.local/bin/zola
key: "zola-${{ env.ZOLA_VERSION }}-${{ runner.os }}-${{ runner.arch }}-${{ env.ZOLA_DIGEST }}"

- name: Install zola
env:
BINARY_CACHE_HIT: ${{ steps.zola-cache.outputs.cache-hit }}
run: |
bash actions/install-zola.sh

- name: Build documentation
run: make -C doc build
14 changes: 14 additions & 0 deletions .headache.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Objective Caml source
".*\\.ml[l]?" -> frame open:"(*" line:"*" close:"*)"
# We add '_' in mli to comply with [ppx_js_style -check-doc-comments].
| ".*\\.mli" -> frame open:"(*_" line:"*" close:"*)"
| ".*\\.fml[i]?" -> frame open:"(*" line:"*" close:"*)"
| ".*\\.mly" -> frame open:"/*" line:"*" close:"*/"
# C source
| ".*\\.[chy]" -> frame open:"/*" line:"*" close:"*/"
# Latex
| ".*\\.tex" -> frame open:"%" line:"%" close:"%"
# Misc
| ".*Makefile.*" -> frame open:"#" line:"#" close:"#"
| ".*README.*" -> frame open:"*" line:"*" close:"*"
| ".*LICENSE.*" -> frame open:"*" line:"*" close:"*"
4 changes: 4 additions & 0 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version=0.29.0
ocaml-version=5.3
profile=janestreet
parse-docstrings=true
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @mbarbin
7 changes: 7 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Code of Conduct

This project has adopted the [OCaml Code of Conduct](https://github.com/ocaml/code-of-conduct/blob/main/CODE_OF_CONDUCT.md).

# Enforcement

This project follows the OCaml Code of Conduct [enforcement policy](https://github.com/ocaml/code-of-conduct/blob/main/CODE_OF_CONDUCT.md#enforcement).
3 changes: 3 additions & 0 deletions COPYING.HEADER
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
central - Manage history between sub-repos and their monorepo
SPDX-FileCopyrightText: 2024-2026 Mathieu Barbin <mathieu.barbin@gmail.com>
SPDX-License-Identifier: MIT
Loading
Loading