#!/bin/sh
# script/cibuild: run the CI build. The Dockerfile runs make fmt-check-go,
# make lint, the prettier check, and make test as build steps. A bare
# `docker build .` would serve those steps from Docker's layer cache on an
# unchanged tree, exiting 0 without running them. CHECK_EPOCH is a build
# arg placed above the check steps in every check stage; passing a fresh
# value each run busts the cache for those steps (and nothing above them),
# so a green build means the checks actually ran. Dependency layers above
# the arg stay cached. The Gitea workflow runs this on push.
set -eu

ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"

main() {
    cd "$ROOT"
    docker build --build-arg CHECK_EPOCH="$(date +%s)" .
}

main "$@"
