#!/usr/bin/env sh # The definition-of-done gates, in the order the workflow steering requires: # # 1. dune build @check type-checks the libraries and the tests # 2. dune runtest runs every Alcotest suite # 3. dune build @fmt confirms ocamlformat and dune formatting are applied # # Exit status is non-zero if any gate fails, so a cron job or the deployment # host's trusted receive-hook helper can enforce the same bar with one call. The # build directory is isolated so a developer's watch build is never disturbed. # # Usage: scripts/ci.sh run all gates # BUILD_DIR=... scripts/ci.sh override the build directory set -eu BUILD_DIR="${BUILD_DIR:-_build-ci}" run() { printf '==> %s\n' "$*" "$@" } run dune build @check --build-dir "$BUILD_DIR" run dune runtest --build-dir "$BUILD_DIR" --force run dune build @fmt --build-dir "$BUILD_DIR" printf '==> all gates passed\n'