# HearthForge CI Pipeline Template # Place this file at .hearthforge-ci.toml in your repository root. image = "docker.io/debian:stable" work_dir = "/ci/build" # Must be absolute. The image needs no git. HearthForge exports the commit # and uploads it. No .git reaches the container, so `git describe` needs a # step that fetches history itself. clone_project_to = "/ci/build/project" # shell = ["/bin/sh", "-c"] shell_setup = "set -euo pipefail" # timeout = 3600 # default per-step timeout in seconds # cpu_limit = 2.0 # CPU cores limit # memory_limit = "2g" # memory limit (k/m/g suffix) # Caches persist between runs. An entry is a bare path, or a table with a # max_size cap (k/m/g suffix). A capped cache is deleted after the run that # takes it over, so the next run starts cold. Uncapped caches grow forever. # cache = [ # { path = "/root/.cargo", max_size = "8g" }, # "/root/.npm", # ] # A cache path must not overlap clone_project_to, in either direction. The # checkout is extracted over that directory. A `clear` step deletes it. [on] push = ["main"] # trigger on push to these branches; use ["*"] for all tag = false # trigger on tag push # manual runs are always available from the UI [variables] # [variables.MY_VAR] # default = "hello" # description = "A custom variable, overridable from the UI" # Files taken from another image before any step runs, like COPY --from. # `to` is a directory and the source basename is kept, so the example below # lands at /usr/local/bin/bun. HearthForge creates `to` when it is missing. # Match the libc: an -alpine tag is musl and will not run on this glibc image. # A "/." suffix on `from` copies the contents instead of the directory itself. # # [[copy]] # image = "docker.io/oven/bun:1.4.0" # from = "/usr/local/bin/bun" # to = "/usr/local/bin" # Steps run in file order. Names are labels only, repeats are allowed. [[steps]] name = "setup" run_sh = "apt-get update -qq && apt-get install -y --no-install-recommends build-essential" timeout = 180 [[steps]] name = "lint" run_sh = "make -C project lint" # warn_on_fail marks the step "warning" instead of failing the run, and the # steps after it still run. # warn_on_fail = true [[steps]] name = "build" run_sh = "make -C project all" [[steps]] name = "test" # run_if is a shell expression; the step is skipped if it returns non-zero # run_if = 'test -n "${CI_COMMIT_TAG}"' run_sh = "make -C project test" [[steps]] name = "package" run_sh = "make -C project dist" # Publish artifacts — these can appear in any step # publish_file: copy a single file directly # publish_file = ["/ci/build/project/dist/my-binary"] # publish_gzip: create a .tar.gz archive (requires tar in image) # publish_gzip = ["/ci/build/project/dist/"] # publish_tar: create a plain .tar archive # publish_tar = ["/ci/build/project/dist/"] # publish_zip: create a .zip archive (requires zip in image) # publish_zip = ["/ci/build/project/dist/"] # publish_zstd: create a .tar.zst archive (requires tar + zstd in image) # publish_zstd = ["/ci/build/project/dist/"] [[steps]] name = "cleanup" # always runs the step even when an earlier one failed. always = true run_sh = "rm -rf /ci/build/scratch"